Unable to upload Cordova code to MFP version 8 with mfpdev command - - ibm-mobilefirst

I have imstall IBM MFP 8 on a Ubuntu server with Tomcat 8.
I have configured mfpdev on my local machine and have access to the MFP server. However, I get the follwoing errors when I tried to register my code to the MFP server.
Can you please let me know how to fix this issue.
command = mfpdev -d app register qamobilegcpmfp1 mfp
Result =
mfpdev-cli verb cli process.argv=["/usr/local/bin/node","/usr/local/bin/mfpdev","-d","app","register","qamobilegcpmfp1","mfp"]
mfpdev-cli verb cli opts={"debug":true,"argv":{"remain":["app","register","qamobilegcpmfp1","mfp"],"cooked":["--debug","app","register","qamobilegcpmfp1","mfp"],"original":["-d","app","register","qamobilegcpmfp1","mfp"]}}
mfpdev-cli verb cli mobilefirst#8.0.0
mfpdev-cli verb cli node#v6.9.5
Verifying server configuration...
mfpdev-cli verb getRuntimes processResp: success
Registering to server:'http://172.16.001.99:3100' runtime:'mfp'
mfpdev-cli verb detectPlatforms detecting platforms present
mfpdev-cli verb parsePlatformInfo Parsing platform: cordova-android
mfpdev-cli verb mfp-config-xml Initializing get, set, and delete methods.
Updated config.xml file located at: /Users/Douments/Development/mymobile/dev/MobileV2/config.xml
Run 'cordova prepare' to propagate changes.
mfpdev-cli verb postRawBody processResp: OK(200) failure: {
mfpdev-cli verb postRawBody "jse_shortmsg": "Server request was unsuccessful. Check your server's availability or contact IBM Support.",
mfpdev-cli verb postRawBody "jse_summary": "Server request was unsuccessful. Check your server's availability or contact IBM Support.: FWLSE0323: State change failure: HTTP 200 - OK",
mfpdev-cli verb postRawBody "jse_cause": {
mfpdev-cli verb postRawBody "jse_shortmsg": "FWLSE0323: State change failure",
mfpdev-cli verb postRawBody "jse_summary": "FWLSE0323: State change failure: HTTP 200 - OK",
mfpdev-cli verb postRawBody "jse_cause": {
mfpdev-cli verb postRawBody "name": "OK"
mfpdev-cli verb postRawBody },
mfpdev-cli verb postRawBody "message": "FWLSE0323: State change failure: HTTP 200 - OK",
mfpdev-cli verb postRawBody "name": "FAILURE"
mfpdev-cli verb postRawBody },
mfpdev-cli verb postRawBody "message": "Server request was unsuccessful. Check your server's availability or contact IBM Support.: FWLSE0323: State change failure: HTTP 200 - OK",
"java.io.FileNotFoundException: http://localhost:3100/mfpadminconfig/api/schema/mfp_default_schema/1.0/configuration/21be5c1b-c988-4af3-b32e-d5ca0895574f?dataOnly=true"

Related

Gitlab package registry NPM Publish showing Error - npm ERR! need auth This command requires you to be logged in to

My .npmrc file contains
#componentlibrary:registry = http://IP/api/v4/projects/342/packages/npm/
'//http://IP/api/v4/projects/342/packages/npm/:_authToken'="AUTH_TOKEN"
My package.json contains
"name": "#componentlibrary/storybookProject",
"version": "1.0.0",
"description": "",
"main": "dist/index.main.js",
"module": "dist/index.module.js",
"files": [
"dist"
],
"publishConfig": {
"#componentlibrary:registry": "http://IP/api/v4/projects/342/packages/npm/"
},
.........
.........
while running npm publish the following error is showing
npm ERR! code ENEEDAUTH
npm ERR! need auth This command requires you to be logged in to http://IP/api/v4/projects/342/packages/npm/
npm ERR! need auth You need to authorize this machine using `npm adduser`
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\user1\AppData\Local\npm-cache\_logs\2022-07-30T07_19_55_191Z-debug-0.log

How do I use Vite and Jest with IntelliJ?

I am trying to run a Jest integration test from Intellij. I right click and say run it tries to run but then I get...
/bin/sh: vite: command not found
I tried adding this to the env vars in the Intellij Run Dialog....
PATH=$PATH:/my/dir/node_modules/.bin
But then I get...
env: node: No such file or directory
node:events:371
throw er; // Unhandled 'error' event
^
Error: spawn pgrep ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
at onErrorNT (node:internal/child_process:478:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (node:internal/child_process:288:12)
at onErrorNT (node:internal/child_process:478:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn pgrep',
path: 'pgrep',
spawnargs: [ '-P', 6190 ]
}
I can confirm that vite is in /my/dir/node_modules/.bin and npx vite works from terminal. Vite is not (nor will I) installed globally
In my case I was using Puppeteer to run integration tests in the browser. Adding npm here...
module.exports = {
...
server: {
command: `npx vite --port 8080 --mode ${process.env.ENV_MODE || "development"}`,
port: 8080,
launchTimeout: 10000,
},
};
Notice was vite --port 8080 now npx vite --port 8080
This may not work with some older versions of NPM that don't include npx (don't remember version but think it is behind LTS).

How to publish my npm package in GitLab NPM Registry?

I hooked up a trial gold plan to test GitLab NPM Registry functionality.
Created a gitlab prohect with the name "bar".
Created a file to generate a token: in the file with the name auth.txt I wrote the line:
grant_type=password&username=my-gitlab-username& password=my-gitlab-password
Generated a token using the command:
curl -d "# auth.txt" -X POST http:/gitlab.com/oauth/token
In the .npmrc file, the path was indicated
gitlab.com/api/v4/projects/my-gitlab-project-id/packages/npm/:_ authToken=my-genereated-token
Created an app.js file for testing, with the contents: console.log('test')
Created a json package with content
{
"name": "#foo/bar",
"version": "1.0.0",
"description": "",
"main": "app.js",
"dependencies": {
"express": "^4.16.4"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node app.js"
},
"author": "",
"license": "ISC",
"publishConfig": {
"registry":"http://gitlab.com/api/v4/projects/my-gitlab-project-id/packages/npm/"
}
}
6.In the folder now there are 3 files:
.npmrc
app.js
package.json
I start publishing the package to the repository with the command
npm --verbose publish
It is not published! writes:
npm verb cli [ '/usr/bin/node', '/usr/local/bin/npm', '--verbose', 'publish' ]
npm info using npm#6.14.2
npm info using node#v13.11.0
npm verb npm-session febf284b8dfbe40b
npm verb publish [ '.' ]
npm info lifecycle #foo/bar#1.0.0~prepublish: #foo/bar#1.0.0
npm info lifecycle #foo/bar#1.0.0~prepare: #foo/bar#1.0.0
npm info lifecycle #foo/bar#1.0.0~prepublishOnly: #foo/bar#1.0.0
npm info lifecycle #foo/bar#1.0.0~prepack: #foo/bar#1.0.0
npm info lifecycle #foo/bar#1.0.0~postpack: #foo/bar#1.0.0
npm notice
npm notice 📦 #foo/bar#1.0.0
npm notice === Tarball Contents ===
npm notice 687B logs
npm notice 175B app.js
npm notice 404B package.json
npm notice 582B README.md
npm notice 55B auth.loc.txt
npm notice 59B auth.txt
npm notice === Tarball Details ===
npm notice name: #foo/bar
npm notice version: 1.0.0
npm notice package size: 1.1 kB
npm notice unpacked size: 2.0 kB
npm notice shasum: c4220955014b80c6948ff2a20124ac8d145d0675
npm notice integrity: sha512-pOQJVaXuneH80[...]DdtCjSLD1vkDQ==
npm notice total files: 6
npm notice
npm http fetch PUT 301 http://gitlab.com/api/v4/projects/my-gitlab-project-id/packages/npm/#foo%2fbar 283ms
npm info lifecycle #foo/bar#1.0.0~publish: #foo/bar#1.0.0
npm info lifecycle #foo/bar#1.0.0~postpublish: #foo/bar#1.0.0
#foo/bar#1.0.0
npm verb exit [ 0, true ]
npm timing npm Completed in 555ms
npm info ok
But in the GitLab in the list on the left - in Packages > List not a single package is displayed, either in the All section or in the NPM section.
Please help me figure out what I'm doing wrong.
You can try to specify the package registry for the exact project.
.npmrc file example:
# Set URL for your scoped packages.
#foo:registry=https://gitlab.com/api/v4/projects/<Source Project ID>/packages/npm/
# Add the token for the scoped packages URL. This will allow you to download
//gitlab.com/api/v4/projects/<Source Project ID>/packages/npm/:_authToken=${CI_JOB_TOKEN}
# with the project you want your package to be uploaded to.
//gitlab.com/api/v4/projects/<Destination Project ID>/packages/npm/:_authToken=${CI_JOB_TOKEN}

Loopback CLI created PersistedModel properites not working when model json updated

I've created a model using below command line tool in mac terminal and created model name with PersistedModel.
lb model
I've got respective json and js file for model and json structure looks as follows.
{
"name": "otp",
"base": "PersistedModel",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {
"otpnumber": {
"type": "string",
"required": true
},
"friends": {
"type": "string",
"required": true
}
},
"validations": [],
"relations": {},
"acls": [],
"methods": {}
}
these were generated from command line/terminal.Now I need to add few properties to this model and I edited this model json as follows
{
"name": "otp",
"base": "PersistedModel",
"idInjection": true,
"options": {
"validateUpsert": true
},
"properties": {
"otpnumber": {
"type": "string",
"required": true
},
"friends": {
"type": "string",
"required": true
},
"firstName": {
"type": "string",
"required": true
},
"city": {
"type": "string",
"required": true
}
},
"validations": [],
"relations": {},
"acls": [],
"methods": {}
}
After editing json file I restarted my localhost server and I found following error in terminal.
events.js:183
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE 0.0.0.0:3000
at Object._errnoException (util.js:1024:11)
at _exceptionWithHostPort (util.js:1046:20)
at Server.setupListenHandle [as _listen2] (net.js:1351:14)
at listenInCluster (net.js:1392:12)
at doListen (net.js:1501:7)
at _combinedTickCallback (internal/process/next_tick.js:141:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
at Function.Module.runMain (module.js:678:11)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
npm verb lifecycle Verification#1.0.0~start: unsafe-perm in lifecycle true
npm verb lifecycle Verification#1.0.0~start: PATH:
/usr/local/lib/node_modules/npm/bin/node-gyp bin:/Users/xxx/Desktop/Samples/Verification/node_modules/.bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
npm verb lifecycle Verification#1.0.0~start: CWD: /Users/xxx/Desktop/Samples/Verification
npm info lifecycle Verification#1.0.0~start: Failed to exec start script
npm verb stack Error: Verification#1.0.0 start: `node .`
npm verb stack Exit status 1
npm verb stack at EventEmitter.<anonymous>
(/usr/local/lib/node_modules/npm/node_modules/npm-
lifecycle/index.js:280:16)
npm verb stack at emitTwo (events.js:126:13)
npm verb stack at EventEmitter.emit (events.js:214:7)
npm verb stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm- lifecycle/lib/spawn.js:55:14)
npm verb stack at emitTwo (events.js:126:13)
npm verb stack at ChildProcess.emit (events.js:214:7)
npm verb stack at maybeClose (internal/child_process.js:925:16)
npm verb stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
npm verb pkgid Verification#1.0.0
npm verb cwd /Users/xxx/Desktop/Samples/Verification
npm verb Darwin 17.0.0
npm verb argv "/usr/local/Cellar/node/8.9.0/bin/node" "/usr/local/bin/npm" "start" "-verbose"
npm verb node v8.9.0
npm verb npm v5.5.1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! Verification#1.0.0 start: `node .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the Verification#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm verb exit [ 1, true ]
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/xxx/.npm/_logs/2017-11-01T12_14_39_706Z-debug.log
That Error: listen EADDRINUSE 0.0.0.0:3000 means that the port 3000 is in use. Try this solution to close it: How do I close an open port from the terminal on the Mac?
Once you've closed the port, you should be able to start up the application again.

npm err! fetch failed in jenkins?

Getting following errors in jenkins.. Any help
npm ERR! fetch failed https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.5.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 502
npm ERR! fetch failed https://registry.npmjs.org/uid-safe/-/uid-safe-1.0.1.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 502
something is up with the cdn hosting of version 1.0.5. You can force the dependency using cookie-signature to require 1.0.6. Express is dependent on this module and you would be able to resolve the issue like so:
"express": {
"version": "~4.9.0",
"from": "express#~4.9.0",
"dependencies": {
"cookie-signature": {
"version": "1.0.6",
"from": "cookie-signature#1.0.6"
}
}
},