How to install mfpdev-cli to offline environment? - ibm-mobilefirst

I am trying to setup offline (does not have internet access) OS X machine for MobileFirst Platform 8.0 development, and failing to install MobileFirst CLI.
I am referring to this article.
I have installed 8.0.0.0-MFPF-DevKit-MacOSX-IF2016080923.zip on the offline machine, then run.sh and console.sh.
Development server has successfully launched, and now I can access to Operations Console.
I have downloaded mfpdev-cli.tar from the Console, and followed the article I cited above.
Copy mfpdev-cli.tar to online machine.
On the online machine, npm --cache ./.cache install mfpdev-cli.tar
Archive .cache directory, and copy the archive file to the offline machine.
On the offline machine, unarchive .cache directory.
sudo npm install --cache ./.cache ./mfpdev-cli.tar -g
Then, I got below:
npm ERR! fetch failed https://registry.npmjs.org/http-proxy/-/http-proxy-1.13.2.tgz
npm WARN retry will retry, error on last attempt: Error: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
Those ERR! and WARN repeats for many other packages.
And at last:
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--cache" "./.cache" "./mfpdev-cli.tar" "-g"
npm ERR! node v4.5.0
npm ERR! npm v2.15.9
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! syscall getaddrinfo
npm ERR! network getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! Please include the following file with any support request:
npm ERR! /Users/babatch/Downloads/mfpdev-cli/npm-debug.log
How do I install mfpdev-cli on offline machine?

The problem is that npm is attempting to contact its online repository still due to some file dependency on the http-proxy package.
What you can do is to get/add this dependency independently and then try again.

I have tried some methods, and finally it got working.
The procedure is below:
On the online machine, npm install ./mfpdev-cli.tar (without -g)
cd node_modules
tar -cvzf mfpdev-cli.tgz mfpdev-cli and copy mfpdev-cli.tgz just created to the offline machine.
On the offline machine, tar -xvzf mfpdev-cli.tgz
sudo cp -r mfpdev-cli /usr/local/lib/node_modules
cd /usr/local/bin
sudo ln -s ../lib/node_modules/mfpdev-cli/bin/cli.js ./mfpdev
At present, it seems to be working fine.

Related

npm install takes forever, says I am behind a proxy

I am trying to install different packages using npm 8.19.2. For example yarn
sudo npm install --global yarn
All I get is
npm ERR! code ETIMEDOUT
npm ERR! syscall connect
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/yarn failed, reason: connect ETIMEDOUT 2606:4700::6810:1823:443
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-12-08T20_14_13_653Z-debug-0.log
I have a fresh installation of Ubuntu 22.04. According to this: http://www.amibehindaproxy.com/ I am not behind a proxy. I do not understand why I should be either. In fact, I don't know what it is.
node --version
v18.12.1
My goal is to get started with react. First step is to just run npx create-react-app my-app. But that does not work.
wget was also slow, then I found this Slow wget speeds when connecting to https pages.
Updating the network settings and disabling IPv6 did the trick.

Failed to install puppeteer using npm - connect EACCES

When I try to run a npm install, it fails at a dependency called puppeteer.
And if I run:
npm install -g puppeteer#1.5.0
(existing in package.json as "puppeteer": "1.5.0",) it fails with the following error:
npm ERR! code EACCES
npm ERR! errno EACCES
npm ERR! FetchError: request to http://registry.npmjs.org/puppeteer failed, reason: connect EACCES 104.16.27.35:80
npm ERR! at ClientRequest.req.on.err (C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\index.js:68:14)
npm ERR! at ClientRequest.emit (events.js:182:13)
npm ERR! at Socket.socketErrorListener (_http_client.js:391:9)
npm ERR! at Socket.emit (events.js:182:13)
npm ERR! at emitErrorNT (internal/streams/destroy.js:82:8)
npm ERR! at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
npm ERR! at process._tickCallback (internal/process/next_tick.js:63:19)
but I can access that URL (http://registry.npmjs.org/puppeteer) using my browser.
The other dependencies specified in package.json work fine. Only this one generates problems.
Details:
npm - 6.2.0
node - v10.9.0
OS: Windows
Any suggestions?
npm ERR! code EACCES
npm ERR! errno EACCES
This is a permission error, on a normal day, I will say you should just use sudo npm install -g puppeteer#1.5.0, but I will suggest you reclaim ownership of the .npm directory by running this:
sudo chown -R $(whoami) ~/.npm
Then you need the write permission in node_modules directory:
sudo chown -R $(whoami) /usr/lib/node_modules
after which you can run your npm install -g puppeteer#1.5.0, This should solve your issue.
UPDATE:
I will suggest two other options for you,
from your terminal, run this:
npm config set unsafe-perm=true
OR
use yarn add for your installation.
also sometimes it just takes a while; I used npm install (I'm trying to use formkit but I'm not sure if it matters) --verbose and I'm getting a bunch of
npm http fetch GET 200 https://registry.npmjs.org/#formkit%2fvalidation
70085ms (cache stale)
so I assume its some issue that requires me to download things that take a very long time. Maybe an issue connecting to the verification server?
Edit: restarted computer, cleared cache, etc etc. Still weird and slow.
Not sure what happened but fixed it by going into my IDE (Jetbrains WebStorm) and changing my package handler in settings to a different nodejs. The one I was using was in Program Files and was having trouble accessing pieces in AppData/Roaming, There was another installation inside AppData and picking that one automatically solved my permissions issue.

Stencil CLI Installation Hiccup

Ran into a small hiccup when attempting to install the stencil CLI on my machine running Ubuntu 14.04. I will attach the contents of the error below. At this point, I've been able to verify that npm, and node are installed correctly and I've been able to verify that I have the correct GitHub permissions by confirming my ability to access https://github.com/bigcommerce-stencil/stencil-cli. Any insight would be appreciated.
dante#Ubuntu:~$ sudo npm install -g bigcommerce-stencil/stencil-cli
[sudo] password for dante:
npm ERR! git clone git#github.com:bigcommerce-stencil/stencil-cli Cloning into bare repository '/home/dante/.npm/_git-remotes/git-github-com-bigcommerce-stencil-stencil-cli-12bc62b4'...
npm ERR! git clone git#github.com:bigcommerce-stencil/stencil-cli Warning: Permanently added the RSA host key for IP address '192.30.252.130' to the list of known hosts.
npm ERR! git clone git#github.com:bigcommerce-stencil/stencil-cli Permission denied (publickey).
npm ERR! git clone git#github.com:bigcommerce-stencil/stencil-cli fatal: Could not read from remote repository.
npm ERR! git clone git#github.com:bigcommerce-stencil/stencil-cli
npm ERR! git clone git#github.com:bigcommerce-stencil/stencil-cli Please make sure you have the correct access rights
npm ERR! git clone git#github.com:bigcommerce-stencil/stencil-cli and the repository exists.
npm ERR! addLocal Could not install bigcommerce-stencil/stencil-cli
npm ERR! Error: ENOENT, stat 'bigcommerce-stencil/stencil-cli'
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! npm-#googlegroups.com
npm ERR! System Linux 3.16.0-57-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "bigcommerce-stencil/stencil-cli"
npm ERR! cwd /home/dante
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path bigcommerce-stencil/stencil-cli
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/dante/npm-debug.log
npm ERR! not ok code 0
I might also add that I've verified that npm is also installed on my machine as it is bundled w/ the node installation. I feel as if this is something that I'm easily overlooking.
This is due to the closed source code. You need to go through the early access dev flow and add your SSH keys, etc. Should resolve it.

Just CANNOT install ember-cli with npm

I'm running on mac osx yosemite 10.10.5 & this is what I get whenever I hit npm install -g ember-cli
npm ERR! Darwin 14.5.0
npm ERR! argv "/Users/itsfadnis/.nvm/versions/io.js/v3.3.1/bin/iojs" "/Users/itsfadnis/.nvm/versions/io.js/v3.3.1/bin/npm" "install" "-g" "ember-cli" "--no-optional"
npm ERR! node v3.3.1
npm ERR! npm v2.14.3
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! syscall connect
npm ERR! network connect ETIMEDOUT 103.245.222.162:80
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! Please include the following file with any support request:
npm ERR! /Users/itsfadnis/npm-debug.log
I have tried the following and none have worked:
Reinstall node and npm
npm set registry http://registry.npmjs.org
Tried with different versions of node - v0.12.8, iojs-v3.3.1, v4.4.2, v5.0
Without optional dependencies npm install -g ember-cli
As administrator sudo npm install -g ember-cli
Network connection is absolutely fine and I'm not behind a proxy.
Any help on this would be appreciated. Thanks.
Turns out it was failing due to a firewall enabled on my router. Disabling it did the trick!

npm install -g ionic not working on windows 7 even I am not on proxy

I am kinda stuck here, npm install -g ionic not working on my home computer which is windows 7 and i dont have any proxy. i am able to download other packages like npm install -g gulp etc.
Already tried changing as suggested by other guys on stackoverflow here
npm config set registry http://registry.npmjs.org/
I am getting bellow error
npm ERR! network read ECONNRESET
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settin
gs.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! Windows_NT 6.1.7600
npm ERR! argv "C:\\node\\\\node.exe" "C:\\node\\node_modules\\npm\\bin\\npm-cli.
js" "install" "ionic"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! syscall read
Try to clear cache first:
npm cache clean
and then Try to install again
npm install -g ionic