babatch
babatch

Reputation: 11

How to install mfpdev-cli to offline environment?

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.

  1. Copy mfpdev-cli.tar to online machine.
  2. On the online machine, npm --cache ./.cache install mfpdev-cli.tar
  3. Archive .cache directory, and copy the archive file to the offline machine.
  4. On the offline machine, unarchive .cache directory.
  5. 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?

Upvotes: 1

Views: 740

Answers (2)

babatch
babatch

Reputation: 11

I have tried some methods, and finally it got working.
The procedure is below:

  1. On the online machine, npm install ./mfpdev-cli.tar (without -g)
  2. cd node_modules
  3. tar -cvzf mfpdev-cli.tgz mfpdev-cli and copy mfpdev-cli.tgz just created to the offline machine.
  4. On the offline machine, tar -xvzf mfpdev-cli.tgz
  5. sudo cp -r mfpdev-cli /usr/local/lib/node_modules
  6. cd /usr/local/bin
  7. sudo ln -s ../lib/node_modules/mfpdev-cli/bin/cli.js ./mfpdev

At present, it seems to be working fine.

Upvotes: 0

Idan Adar
Idan Adar

Reputation: 44516

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.

Upvotes: 0

Related Questions