Cannot install on Node v0.10 in env with no internet access
bajtos opened this issue · 4 comments
strong-globalize cannot be installed on Node v0.10 in environments that don't allow access to the internet, which is quite common in enterprises.
As a result, any packages depending on strong-globalize, e.g. loopback
, cannot be installed in those environments either.
This issue is related to #54.
@Setogit PTAL
cc @rmg @sam-github
Steps to reproduce
- setup local npm registry, using e.g. sinopia
- run
npm install strong-globalize
to fill the cache - turn off internet access on your computer
- remove
node_modules
- run
https://www.npmjs.com/package/sinopia
again
Output of npm install
:
$ npm install strong-globalize
npm WARN peerDependencies The peer dependency cldr-data@>=25 included from globalize will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency cldr-data@>=25 included from cldrjs will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
-
> cldr-data@29.0.1 install /private/tmp/xxx/node_modules/strong-globalize/node_modules/globalize/node_modules/cldr-data
> node install.js
GET `https://github.com/unicode-cldr/cldr-core/archive/29.0.0.zip`
GET `https://github.com/unicode-cldr/cldr-dates-modern/archive/29.0.0.zip`
GET `https://github.com/unicode-cldr/cldr-cal-buddhist-modern/archive/29.0.0.zip`
GET `https://github.com/unicode-cldr/cldr-cal-chinese-modern/archive/29.0.0.zip`
GET `https://github.com/unicode-cldr/cldr-cal-coptic-modern/archive/29.0.0.zip`
GET `https://github.com/unicode-cldr/cldr-cal-dangi-modern/archive/29.0.0.zip`
GET `https://github.com/unicode-cldr/cldr-cal-ethiopic-modern/archive/29.0.0.zip`
GET `https://github.com/unicode-cldr/cldr-cal-hebrew-modern/archive/29.0.0.zip`
GET `https://github.com/unicode-cldr/cldr-cal-indian-modern/archive/29.0.0.zip`
GET `https://github.com/unicode-cldr/cldr-cal-islamic-modern/archive/29.0.0.zip`
GET `https://github.com/unicode-cldr/cldr-cal-japanese-modern/archive/29.0.0.zip`
GET `https://github.com/unicode-cldr/cldr-cal-persian-modern/archive/29.0.0.zip`
GET `https://github.com/unicode-cldr/cldr-cal-roc-modern/archive/29.0.0.zip`
GET `https://github.com/unicode-cldr/cldr-localenames-modern/archive/29.0.0.zip`
GET `https://github.com/unicode-cldr/cldr-misc-modern/archive/29.0.0.zip`
GET `https://github.com/unicode-cldr/cldr-numbers-modern/archive/29.0.0.zip`
GET `https://github.com/unicode-cldr/cldr-segments-modern/archive/29.0.0.zip`
GET `https://github.com/unicode-cldr/cldr-units-modern/archive/29.0.0.zip`
Error: getaddrinfo ENOTFOUND
at errnoException (dns.js:37:11)
at Object.onanswer [as oncomplete] (dns.js:126:16)
npm ERR! Darwin 14.5.0
npm ERR! argv "/Users/bajtos/.nvm/v0.10.44/bin/node" "/Users/bajtos/.nvm/v0.10.44/bin/npm" "install" "strong-globalize"
npm ERR! node v0.10.44
npm ERR! npm v2.15.0
npm ERR! code ELIFECYCLE
npm ERR! cldr-data@29.0.1 install: `node install.js`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the cldr-data@29.0.1 install script 'node install.js'.
npm ERR! This is most likely a problem with the cldr-data package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs cldr-data
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls cldr-data
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /private/tmp/xxx/npm-debug.log
Apparently this is a bug in cldr-data's install
script.
var isNpm3;
try {
var npmv = child_process.execSync('npm -v').toString('utf8');
isNpm3 = (npmv.split('.')[0] == '3');
} catch(error) {
// Better safe than sorry.
isNpm3 = true;
}
IIRC, execSync
was added in Node v0.12.
Perhaps we should check env variables provided by npm
to detect the version? Unfortunately the npm version is not provided directly, I see the version only in the useragent string.
npm_config_user_agent: 'npm/2.15.1 node/v0.10.46 darwin x64'
npm_config_user_agent: 'npm/3.10.3 node/v6.3.0 darwin x64',
Submitted a pull request to cld-data
project to fix the problem: rxaviers/cldr-data-npm#34
rxaviers/cldr-data-npm#34 has been landed and published, I am closing this issue as fixed.