package.json for globally installed packages - node.js

I'm trying to update my nuclide-server. The output of sudo npm update -g nuclide --verbose is:
$ sudo npm update -g --dev nuclide --verbose
npm info it worked if it ends with ok
npm verb cli [ '/usr/bin/nodejs',
npm verb cli '/usr/bin/npm',
npm verb cli 'update',
npm verb cli '-g',
npm verb cli '--dev',
npm verb cli 'nuclide',
npm verb cli '--verbose' ]
npm info using npm#4.2.0
npm info using node#v7.9.0
npm verb request uri https://registry.npmjs.org/nuclide
npm verb request no auth needed
npm info attempt registry request try #1 at 11:02:17 AM
npm verb request id bf1180b825d1a807
npm verb etag W/"590a3387-6633d"
npm verb lastModified Wed, 03 May 2017 19:46:15 GMT
npm http request GET https://registry.npmjs.org/nuclide
npm http 304 https://registry.npmjs.org/nuclide
npm verb headers { date: 'Fri, 12 May 2017 11:02:17 GMT',
npm verb headers via: '1.1 varnish',
npm verb headers 'cache-control': 'max-age=300',
npm verb headers etag: 'W/"590a3387-6633d"',
npm verb headers age: '132',
npm verb headers connection: 'keep-alive',
npm verb headers 'x-served-by': 'cache-syd1625-SYD',
npm verb headers 'x-cache': 'HIT',
npm verb headers 'x-cache-hits': '1',
npm verb headers 'x-timer': 'S1494586937.425880,VS0,VE0',
npm verb headers vary: 'Accept-Encoding' }
npm verb etag https://registry.npmjs.org/nuclide from cache
npm verb get saving nuclide to /home/daniel/.npm/registry.npmjs.org/nuclide/.cache.json
npm verb correctMkdir /home/daniel/.npm correctMkdir not in flight; initializing
npm verb outdated not updating nuclide because it's currently at the maximum version that matches its specified semver range
npm verb exit [ 0, true ]
npm info ok
Searching Google hasn't turned anything up to help this, they all refer to a package.json and changing some stuff in there, but I don't have a package.json (probably because I'm installing this globally). How do I find the config or do something else to just allow me to update my nuclide package?
System info:
Ubuntu 16.04
npm version: 4.2.0
node version: v7.9.0
Current nuclide version: 217

The package.json config your looking for is wherever you installed node orginally, on windows it's at /usr/local. On unix systems it can be found via usr/local/lib/node or /usr/local/lib/node_modules.
you can alternatively run sudo npm root -g to find where your installtion.
Furthermore it can be found by following the links to the nodejs application which will take you to your installation folder. These links are made after a successful instillation.
Afterwhich you can remove the remove/update the dependancy within package.jsonand run npm i -g again.
Specifically on your version your installation folder is /usr/local/lib/node_modules.

Related

npm install gifsicle behind corporate proxy failed or stuck at windows system

windows 7,
npm#3.10.3,
node#v6.7.0
npm and git are set up for using the corporate proxy.
It took me a while to figure out how git and npm can use the corporate proxy, luckily it was successful done.
npm config file (.npmrc) looks like:
strict-ssl=false
proxy=http://domain%5Cmyname:mypassword#corporateproxy:8088/
http-proxy=http://domain%5Cmyname:mypassword#corporateproxy:8088/
https-proxy=http://domain%5Cmyname:mypassword#corporateproxy:8088/
cache-lock-wait=30000
cache-lock-retries=10
cache-lock-stale=300000
start installation
npm install gifsicle --verbose
and here is the logging:
C:\temp\2018_0110\estatico>npm install gifsicle --verbose
npm info it worked if it ends with ok
npm verb cli [ 'C:\\temp\\TOOLS\\PortableNode\\node.exe',
npm verb cli 'C:\\temp\\TOOLS\\PortableNode\\node_modules\\npm\\bin\\npm-cli.j
s',
npm verb cli 'install',
npm verb cli 'gifsicle',
npm verb cli '--verbose' ]
npm info using npm#3.10.3
npm info using node#v6.7.0
npm verb request uri https://registry.npmjs.org/gifsicle
npm verb request no auth needed
npm info attempt registry request try #1 at 09:00:29
npm verb request id 7014dcca318052d1
npm verb etag "5a108ad8-73b8"
npm verb lastModified Sat, 18 Nov 2017 19:32:40 GMT
npm http request GET https://registry.npmjs.org/gifsicle
npm http 304 https://registry.npmjs.org/gifsicle
npm verb headers { date: 'Wed, 17 Jan 2018 08:00:14 GMT',
npm verb headers via: '1.1 varnish',
npm verb headers 'cache-control': 'max-age=300',
npm verb headers etag: '"5a108ad8-73b8"',
npm verb headers age: '13585',
npm verb headers connection: 'close',
npm verb headers 'x-served-by': 'cache-hhn1546-HHN',
npm verb headers 'x-cache': 'HIT',
npm verb headers 'x-cache-hits': '10',
npm verb headers 'x-timer': 'S1516176014.461012,VS0,VE0',
npm verb headers vary: 'Accept-Encoding, Accept' }
npm verb etag https://registry.npmjs.org/gifsicle from cache
npm verb get saving gifsicle to C:\Users\MYUSERHOME\AppData\Roaming\npm-cach
e\registry.npmjs.org\gifsicle\.cache.json
npm verb correctMkdir C:\Users\MYUSERHOME\AppData\Roaming\npm-cache correctM
kdir not in flight; initializing
npm verb cache add spec gifsicle
npm verb addNamed "latest" is being treated as a dist-tag for gifsicle
npm info addNameTag [ 'gifsicle', 'latest' ]
npm verb addNameTag registry:https://registry.npmjs.org/gifsicle not in flight;
fetching
npm verb get https://registry.npmjs.org/gifsicle not expired, no request
npm verb addNamed "3.0.4" is a plain semver version for gifsicle
npm verb afterAdd C:\Users\MYUSERHOME\AppData\Roaming\npm-cache\gifsicle\3.0
.4\package\package.json not in flight; writing
npm verb correctMkdir C:\Users\MYUSERHOME\AppData\Roaming\npm-cache correctM
kdir not in flight; initializing
npm verb afterAdd C:\Users\MYUSERHOME\AppData\Roaming\npm-cache\gifsicle\3.0
.4\package\package.json written
npm verb correctMkdir C:\Users\MYUSERHOME\AppData\Roaming\npm-cache\_locks c
orrectMkdir not in flight; initializing
npm verb lock using C:\Users\MYUSERHOME\AppData\Roaming\npm-cache\_locks\sta
ging-fdad36d07e8f1a67.lock for C:\temp\2018_0110\estatico\node_modules\.staging
npm verb unbuild node_modules\.staging\gifsicle-c326b995
npm verb gentlyRm don't care about contents; nuking C:\temp\2018_0110\estatico\n
ode_modules\.staging\gifsicle-c326b995
npm verb tar unpack C:\Users\MYUSERHOME\AppData\Roaming\npm-cache\gifsicle\3
.0.4\package.tgz
npm verb tar unpacking to C:\temp\2018_0110\estatico\node_modules\.staging\gifsi
cle-c326b995
npm verb gentlyRm don't care about contents; nuking C:\temp\2018_0110\estatico\n
ode_modules\.staging\gifsicle-c326b995
npm verb gentlyRm don't care about contents; nuking C:\temp\2018_0110\estatico\n
ode_modules\.staging\gifsicle-c326b995\node_modules
npm info lifecycle gifsicle#3.0.4~preinstall: gifsicle#3.0.4
npm info linkStuff gifsicle#3.0.4
npm verb linkBins gifsicle#3.0.4
npm verb link bins [ { gifsicle: 'cli.js' },
npm verb link bins 'C:\\temp\\2018_0110\\estatico\\node_modules\\.bin',
npm verb link bins false ]
npm verb linkMans gifsicle#3.0.4
npm info lifecycle gifsicle#3.0.4~install: gifsicle#3.0.4
npm info lifecycle gifsicle#3.0.4~postinstall: gifsicle#3.0.4
> gifsicle#3.0.4 postinstall C:\temp\2018_0110\estatico\node_modules\gifsicle
> node lib/install.js
1.) installation stuck for a long time at the gifsicle#3.0.4 postinstall script 'node lib/install.js'.
2.)15 min or more later next message
‼ tunneling socket could not be established, cause=read ECONNRESET
‼ gifsicle pre-build test failed
i compiling from source
3.) last message
× RequestError: tunneling socket could not be established, cause=socket hang u
p
at ClientRequest.<anonymous> (C:\temp\2018_0110\estatico\node_modules\got\in
dex.js:74:21)
at ClientRequest.g (events.js:291:16)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:188:7)
at ClientRequest.onError (C:\temp\2018_0110\estatico\node_modules\caw\node_m
odules\tunnel-agent\index.js:178:21)
at ClientRequest.g (events.js:291:16)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:188:7)
at TLSSocket.socketErrorListener (_http_client.js:308:9)
at emitOne (events.js:96:13)
npm verb lifecycle gifsicle#3.0.4~postinstall: unsafe-perm in lifecycle true
npm verb lifecycle gifsicle#3.0.4~postinstall: PATH: C:\temp\TOOLS\PortableNode\
node_modules\npm\bin\node-gyp-bin;C:\temp\2018_0110\estatico\node_modules\gifsic
le\node_modules\.bin;C:\temp\2018_0110\estatico\node_modules\.bin;C:\temp\TOOLS\
PortableNode;C:\temp\TOOLS\PortableNode;C:\temp\TOOLS\PortableGit\cmd;C:\Program
Files (x86)\MQSeries Client\Java\lib;C:\ProgramData\Oracle\Java\javapath;C:\Win
dows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPow
erShell\v1.0\;C:\Program Files (x86)\CTV_V7_E-I\isiscomm\w3\lib;C:\Program Files
(x86)\MQSeries Client\bin64;C:\Program Files (x86)\MQSeries Client\bin;C:\Progr
am Files (x86)\MQSeries Client\tools\c\samples\bin;C:\Program Files\Citrix\Syste
m32\;C:\Program Files\Citrix\ICAService\;C:\Program Files (x86)\UltraEdit\;C:\Pr
ogram files\IBM\sqllib\bin;C:\Program files\IBM\sqllib\funtion;C:\Program Files
(x86)\Subversion;C:\Program Files\TortoiseSVN\bin;C:\Users\MYUSERHOME\.dnx\b
in;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files (x86)\Windows Kits\8.1\
Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\120\Tools\Bin
n\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\
McAfee\MOVE AV Client\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Fi
les (x86)\TAA\taaseu;C:\Program Files (x86)\UltraEdit
npm verb lifecycle gifsicle#3.0.4~postinstall: CWD: C:\temp\2018_0110\estatico\n
ode_modules\gifsicle
npm verb unlock done using C:\Users\MYUSERHOME\AppData\Roaming\npm-cache\_lo
cks\staging-fdad36d07e8f1a67.lock for C:\temp\2018_0110\estatico\node_modules\.s
taging
estatico#5.0.0 C:\temp\2018_0110\estatico
`-- gulp-imagemin#3.0.3
`-- imagemin-gifsicle#5.2.0
`-- gifsicle#3.0.4
npm verb exit [ 0, true ]
npm info ok
while installation node-gyp will be triggered and it seems that the proxy settings not used from npm.
I can successful install gifsicle at another computer and within direkt internetconnection without any issue.
Q: Has anybody successful installed gifsicle behind corporate proxy, then please tell me how it`s done?
EDIT:
This is the part where it stuck at least.
C:\temp\estatico\node_modules\gifsicle\lib>node install.js --verbose
'use strict';
var BinBuild = require('bin-build');
var log = require('logalot');
var bin = require('./');
bin.run(['--version'], function (err) {
if (err) {
log.warn(err.message);
log.warn('gifsicle pre-build test failed');
log.info('compiling from source');
var cfg = [
'./configure --disable-gifview --disable-gifdiff',
'--prefix="' + bin.dest() + '" --bindir="' + bin.dest() + '"'
].join(' ');
var builder = new BinBuild()
.src('https://github.com/kohler/gifsicle/archive/v1.88.tar.gz')
.cmd('autoreconf -ivf')
.cmd(cfg)
.cmd('make install');
return builder.run(function (err) {
if (err) {
log.error(err.stack);
return;
}
log.success('gifsicle built successfully');
});
}
log.success('gifsicle pre-build test passed successfully');
});
To install npm packages through a firewall I found that I needed to set proxy environment variable(s) instead of using npm config. This seems to have changed a bit with different versions of npm. I currently set 'http_proxy' and 'https_proxy' and that seems to cover all npm versions I use.
I've not used gifsicle
I've faced similar issue not exactly same.npm install command for most of the packages. I am behind corporate proxy.
For this i tried many solutions it never worked.
Finally i did this,
Try to run the following command in cmd,
npm config set https-proxy "http://your_companyproxy_here:8080"
Then it will work fine.

How to update a node.js package so package.json is changed too

It looks like npm up [package] doesn't work. Here is an example that a package doesn't get updated.
In package.json
"dependencies": {
"vasync": "^1.6.4"
}
Check version:
$ npm outdated
vasync 1.6.4 1.6.4 2.1.0 app
Trying to update:
$ npm up vasync
Now check again and the result is the same:
$ npm outdated
vasync 1.6.4 1.6.4 2.1.0 app
What does npm update do actually? How to use it to update both, a package itself and a package.json as well?
npm up vasync --save
This should work perfectly, if you still get the same result, try verbose mode, example
❯ npm update rxjs --save --verbose
npm info it worked if it ends with ok
npm verb cli [ '/usr/local/Cellar/node/8.2.1/bin/node',
npm verb cli '/usr/local/bin/npm',
npm verb cli 'update',
npm verb cli 'rxjs',
npm verb cli '--save',
npm verb cli '--verbose' ]
npm info using npm#5.5.1
npm info using node#v8.2.1
npm verb npm-session 113475d097da3551
npm verb request uri http://registry.npmjs.org/rxjs
npm verb request no auth needed
npm info attempt registry request try #1 at 3:22:03 PM
npm verb request id ac8c2e37f0875abd
npm http request GET http://registry.npmjs.org/rxjs
npm http 200 http://registry.npmjs.org/rxjs
npm verb headers { server: 'nginx/1.10.1',
npm verb headers 'content-type': 'application/json',
npm verb headers 'last-modified': 'Tue, 24 Oct 2017 17:52:42 GMT',
npm verb headers etag: 'W/"59ef7dea-36f8e"',
npm verb headers 'content-encoding': 'gzip',
npm verb headers 'cache-control': 'max-age=300',
npm verb headers 'content-length': '14997',
npm verb headers 'accept-ranges': 'bytes',
npm verb headers date: 'Wed, 25 Oct 2017 09:22:04 GMT',
npm verb headers via: '1.1 varnish',
npm verb headers age: '243',
npm verb headers connection: 'keep-alive',
npm verb headers 'x-served-by': 'cache-bma7027-BMA',
npm verb headers 'x-cache': 'HIT',
npm verb headers 'x-cache-hits': '2',
npm verb headers 'x-timer': 'S1508923324.118963,VS0,VE0',
npm verb headers vary: 'Accept-Encoding, Accept' }
npm verb outdated not updating rxjs because it's currently at the maximum version that matches its specified semver range
npm verb exit [ 0, true ]
npm info ok
In my case, its saying not updating rxjs because it's currently at the maximum version that matches its specified semver range
Try using this command if you want to add the dependency inside package.json:
npm update {package.name} --save
The parameter --save lets node know that you want to reflect the changes inside your package.json, so when you deploy the project and install the packages it will be considered aswell.
Regards.

NPM install hangs on loadRequestedDeps

When I download any package using NPM, it hangs on the last command "loadRequestedDeps." I've added my whole -verbose output to the end of this question for reference. It will just sit there until I cancel the command, and nothing will be installed and my package.json will not be updated.
What could the issue be? I've looked around but haven't found out how to fix my particular problem.
Here's some info:
OS is Windows 10
Node version is 6.9.1
NPM version is 3.10.8
My CPU maxes out at 100% whenever I run NPM install. Could that be the issue itself? I used to be able to use NPM install on this computer, however.
Thanks for anyone who can help. The verbose output is below.
npm info it worked if it ends with ok
npm info using npm#3.10.8
npm info using node#v6.9.1
npm info ok
npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
npm verb cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli 'install',
npm verb cli 'moment',
npm verb cli '--save',
npm verb cli '-verbose' ]
npm info using npm#3.10.8
npm info using node#v6.9.1
npm verb request uri https://registry.npmjs.org/moment
npm verb request no auth needed
npm info attempt registry request try #1 at 11:19:11 AM
npm verb request id 6aa9ece5a04fcd33
npm verb etag W/"583b0871-194b0"
npm verb lastModified Sun, 27 Nov 2016 16:23:13 GMT
npm http request GET https://registry.npmjs.org/moment
npm http 304 https://registry.npmjs.org/moment
npm verb headers { date: 'Tue, 29 Nov 2016 19:19:02 GMT',
npm verb headers via: '1.1 varnish',
npm verb headers 'cache-control': 'max-age=300',
npm verb headers etag: 'W/"583b0871-194b0"',
npm verb headers age: '11',
npm verb headers connection: 'keep-alive',
npm verb headers 'x-served-by': 'cache-sjc3136-SJC',
npm verb headers 'x-cache': 'HIT',
npm verb headers 'x-cache-hits': '1',
npm verb headers 'x-timer': 'S1480447142.653125,VS0,VE0',
npm verb headers vary: 'Accept-Encoding' }
npm verb etag https://registry.npmjs.org/moment from cache
npm verb get saving moment to C:\Users\Zach\AppData\Roaming\npm-cache\registry.npmjs.org\moment\.cache.json
npm verb correctMkdir C:\Users\Zach\AppData\Roaming\npm-cache correctMkdir not in flight; initializing
npm verb cache add spec moment
npm verb addNamed "latest" is being treated as a dist-tag for moment
npm info addNameTag [ 'moment', 'latest' ]
npm verb addNameTag registry:https://registry.npmjs.org/moment not in flight; fetching
npm verb get https://registry.npmjs.org/moment not expired, no request
npm verb addNamed "2.17.0" is a plain semver version for moment
npm verb addRemoteTarball https://registry.npmjs.org/moment/-/moment-2.17.0.tgz not in flight; adding
npm verb addRemoteTarball [ 'https://registry.npmjs.org/moment/-/moment-2.17.0.tgz',
npm verb addRemoteTarball 'a4c292e02aac5ddefb29a6eed24f51938dd3b74f' ]
[ ..............] \ loadRequestedDeps: verb addRemoteTarball [ 'https://registry.npmjs.org/moment/-/moment-2.17.0.tgz',
I had this exact same issue, and it drove me crazy for about a day before I found these solutions.
After creating a new "tmp" folder in my C drive, and then changing the TEMP variable in my SYSTEM Environment variables to C:\tmp.
My "npm install" was still not working. (This action was based on Zach Nagatani's answer.)
I also had two TEMP variables defined in my USER Environment variables, and I had to delete one of the variables for my "npm install" to start working.
The above action was based on this post: https://github.com/npm/npm/issues/7590
I was so glad when I found it. Many thanks to you all.
Create new folder tmp in C: drive and go to the command prompt and type:
npm config set tmp C:/tmp
this is very general error ..
you have to debug with
npm install -verbose
it maybe
1) locked package.json
2) you are in private network and can't access outside world for some reason
3) cache is not good ( you may try with npm clear cache ) or ( cache verify ) or even changing its path (npm config set tmp )
npm cache verify did the trick for me!
EDIT
npm was stuck on loadAllDepsIntoIdealTree.
I couldn't figure out the issue, so it got me here. I saw #franckstifler's answer about npm cache clear and tried that, but the command was deprecated.
The shell itself instead suggested using npm cache verify. I did that and it worked! The garbage data in cache got swiped away and I rerun npm i --save-dev on my working folder and it worked.
Sometimes when you have tried several times to install a package, you need to clear your cache: npm cache clear. But yarn is a really better option compared to npm, it is fast and reliable. Install it with npm -i -g yarn and to download dependencies yarn add package_name from a package.json you use yarn install.
So, after trying to clear the npm cache, update my npm and node version, reinstalling npm and node, etc... I found that changing my Environment Variable TEMP to = C:\tmp worked. I'm not sure why. Any info would be nice.
I found the answer from this thread: npm install hangs on windows with multiple temp directories set
NOTE: I could use the method he uses (using the set command on my directory, but I had to do this with every new project. Changing the variable via System, Advanced System Settings, Environment Variables changed it globablly, so now I'm all good to go.
i tried googling nothing worked for me finally i found the fix by setting the environment varible
try use https://github.com/npm/npm/issues/10462
Finally Resolved The Problem(Wondering)
Change Both System And User TEMP Variable point to C:\temp and make a directory as C:\temp.
1.TEMP=C:\temp;
2.Make A Directory temp at C:\

npm install does not work when running npm install cordova

I am using Ionic framework to build hybrid apps. According to the official website, i need to get the version 4.2.4 of Node.js, which includes npm package manager. One of the dependencies needed by Ionic is cordova so that i run the following command to get it
C:\Users\ferrero>npm install -g cordova
After then, the console logs
npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
npm verb cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli 'prefix',
npm verb cli '-g' ]
npm info using npm#2.14.12
npm info using node#v4.2.4
npm verb exit [ 0, true ]
npm info ok
npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
npm verb cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm- cli.js',
npm verb cli 'install',
npm verb cli 'cordova' ]
npm info using npm#2.14.12
npm info using node#v4.2.4
npm verb config Skipping project config: C:\Users\ferrero/.npmrc.
(matches userconfig)
npm verb install initial load of C:\Users\ferrero\package.json
npm verb readDependencies loading dependencies from C:\Users\ferrero\package.json
npm verb cache add spec cordova
npm verb addNamed "latest" is being treated as a dist-tag for cordova
npm info addNameTag [ 'cordova', 'latest' ]
npm verb addNameTag registry:https://registry.npmjs.org/cordova not in flight; fetching
npm verb request uri https://registry.npmjs.org/cordova
npm verb request no auth needed
npm info attempt registry request try #1 at 16:47:06
npm verb request id 62f85abc5c5b7cd5
npm verb etag "6KQ69KRX02Y8MUJFT56H9DE6N"
npm http request GET https://registry.npmjs.org/cordova
npm info retry will retry, error on last attempt: Error: self signed certificate in certificate chain
As you can see from log, npm run version 2.14.12 and it complains that the cause is a self signed certificate - likely issued by https://registry.npmjs.org/cordova. So, to overcome this issue, I run
npm config set registry=http://registry.npmjs.org
And, after that (just the relevant part)
C:\Users\ferrero>npm install -g cordova
npm verb cache add spec cordova
npm verb addNamed "latest" is being treated as a dist-tag for cordova
npm info addNameTag [ 'cordova', 'latest' ]
npm verb addNameTag registry:http://registry.npmjs.org/cordova not in flight; fetching
npm verb request uri http://registry.npmjs.org/cordova
npm verb request no auth needed
npm info attempt registry request try #1 at 16:59:34
npm verb request id 359f93cb3aa8b76e
npm verb etag "6KQ69KRX02Y8MUJFT56H9DE6N"
npm http request GET http://registry.npmjs.org/cordova
npm http 304 http://registry.npmjs.org/cordova
npm verb headers {
date: 'Tue, 26 Jan 2016 18:59:34 GMT',
npm verb headers via: '1.1 varnish',
npm verb headers 'cache-control': 'max-age=300',
npm verb headers etag: '"6KQ69KRX02Y8MUJFT56H9DE6N"',
npm verb headers age: '263',
npm verb headers connection: 'keep-alive',
npm verb headers 'x-served-by': 'cache-atl6230-ATL',
npm verb headers 'x-cache': 'HIT',
npm verb headers 'x-cache-hits': '1',
npm verb headers 'x-timer': 'S1453834774.362657,VS0,VE1',
npm verb headers vary: 'Accept'
}
npm verb etag http://registry.npmjs.org/cordova from cache
npm verb get saving cordova to C:\Users\ferrero\AppData\Roaming\npm-cache\registry.npmjs.org\cordova\.cache.json
npm verb addNamed "5.4.1" is a plain semver version for cordova
npm verb addRemoteTarball http://registry.npmjs.org/cordova/-/cordova-5.4.1.tgz
not in flight; adding
npm verb addRemoteTarball [ 'http://registry.npmjs.org/cordova/-/cordova-5.4.1.tgz',
npm verb addRemoteTarball 'bc56bc1d3c5387a7926408212dfbce59002f9d76' ]
This time, it does not complain anything else. Instead, the loading indicator - a pipe character - keep running and running. So, what should i do in order to download such dependency ?
We seem to be looking at two distinct issues here.
The certificate error is likely due to an outbound SSL proxy. Someone, most likely your employer, is opening all SSL traffic on the way out. To fix it, you'll need to tell NPM that this certificate is okay by importing the CA certificate of the proxy in use.
npm config set cafile = "/the/certificate/file.pem"
You may also need to set the proxy address for npm as well:
npm config set proxy http://proxy.example.com:3128
npm config set https-proxy http://proxy.example.com:3128
The incompatibility with node 5.0 seems to have been fixed according to my research. The documentation just seems to be out of date.
The bug in Cordova which may have been the issue was a missing method in the Q promises library, which Cordova depends upon.
In November 2015 a user was able to use Ionic successfully with node 5.1.0.
Even i faced same issue while doing any npm install -g XXX command, it was resolved by npm config set strict-ssl false
Ok, I think the note about node 4 vs node 5 is from the old days of cordova 5.0 when there was a problem when installing cordova with node 5.
Since then they released cordova 5.4 and cordova 6 where there is no more issue with node 5.
I usually don't use ionic, but to be sure, with my fresh install of node v5.4.1, where I already was running cordova 5.4 (installed also with node 5.4.1), I:
installed cordova 6 : npm install -g cordova
installed ionic 1.7.13 : npm install -g ionic
created a ionic app : ionic start myApp tabs
run the app on an android device
cd myApp
cordova platform add android
ionic run android
And everything worked perfectly.
So I assume that you can safely try to install the latest version of node to build apps with ionic.
And maybe node 5.4.1 will solve the issue you face with node 4.2.4?
Problem here it that you are using self-signed certificate according to error self signed certificate in certificate chain.
If you want to fix the error here some info for you:
How to fix SSL certificate error when running Npm on Windows?
https://confluence.atlassian.com/display/SOURCETREEKB/Resolving+SSL+Self-Signed+Certificate+Errors
But if there is no way to deal with problem just set http registry(carry about config word)
npm config set registry http://registry.npmjs.org/
A similar thing happened to me before and what worked for me back then was.
First, uninstall node and npm.
Second, delete npm and npm-cache folders on C:\Users\yourname\AppData\Roaming.
And lastly, redownload and reinstall a fresh copy of node.js.
I'm not sure if this is gonna work on your case but hope this helps!!

npm not installing tar package from cache when forced

I'm using Node v5.0.0 and npm v3.3.6 and running into a very isolated issue with he tar package. Due to corporate firewalls I was forced to clone the Git repository and install it from that
My problem is that despite forcing npm to install packages from the cache, tar is the only package that insists on downloading it from npm's registry.
$ npm install tar#2.2.1 --verbose --cache-min=999999999999
npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
npm verb cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli 'install',
npm verb cli 'tar#2.2.1',
npm verb cli '--verbose',
npm verb cli '--cache-min=999999999999' ]
npm info using npm#3.3.6
npm info using node#v5.0.0
npm verb get http://registry.npmjs.org/tar not expired, no request
npm verb cache add spec tar#2.2.1
npm verb addNamed "2.2.1" is a plain semver version for tar
npm verb addNameVersion registry:http://registry.npmjs.org/tar not in flight; fetching
npm verb get http://registry.npmjs.org/tar not expired, no request
npm verb addRemoteTarball http://registry.npmjs.org/tar/-/tar-2.2.1.tgz not in flight; adding
npm verb addRemoteTarball [ 'http://registry.npmjs.org/tar/-/tar-2.2.1.tgz',
npm verb addRemoteTarball '8e4d2a256c0e2185c6b18ad694aec968b83cb1d1' ]
npm info retry fetch attempt 1 at 8:38:23 AM
npm info attempt registry request try #1 at 8:38:23 AM
npm http fetch GET http://registry.npmjs.org/tar/-/tar-2.2.1.tgz
npm verb request id b8672d43f7b2c569
npm http fetch 503 http://registry.npmjs.org/tar/-/tar-2.2.1.tgz
npm info retry will retry, error on last attempt: Error: server error 503
I've double checked my cache and can see that tar v2.2.1 is in fact present and functional.
$ npm cache list | grep 'tar\\2.2.1'
~\AppData\Roaming\npm-cache\tar\2.2.1
~\AppData\Roaming\npm-cache\tar\2.2.1\package
~\AppData\Roaming\npm-cache\tar\2.2.1\package.tgz
~\AppData\Roaming\npm-cache\tar\2.2.1\package\package.json
For what it's worth, I'm able to overcome this issue by simply adding the project's Git repository in my dependencies folder and use npm install deps/node-tar before doing npm install. Still doesn't explain the problem at hand, however.

Resources