With Node 0.12.2 and npm 2.7.4 ionic installation

2019-04-16 00:36发布

问题:

I am downloaded the node installation file "node-v0.12.2-x64.msi" for 64 bit windows 7 OS. All node and npm commands are working fine. I checked both the node and npm versions.

But when I try to install ionic by the following command:

npm install -g cordova ionic

Its gives me the following error:

npm WARN engine cordova-js@3.9.0: wanted: {"node":"~0.10.x"} (current: {"node":"
0.12.2","npm":"2.7.4"})

npm WARN engine npm@1.3.4: wanted: {"node":">=0.6","npm":"1"} (current: {"node":
"0.12.2","npm":"2.7.4"})

npm WARN engine xmlbuilder@2.2.1: wanted: {"node":"0.8.x || 0.10.x"} (current: {
"node":"0.12.2","npm":"2.7.4"})

npm WARN installMany normalize-package-data was bundled with npm@1.3.4, but bund
led package wasn't found in unpacked tree

npm ERR! tar.unpack untar error C:\Users\Biswarup\AppData\Local\Temp\npm-1484-8b
f97a1e\registry.npmjs.org\request\-\request-2.9.203.tgz

npm ERR! cb() never called!

Biswarup is my username in above all cases.

I check the following links for troubleshooting, but nothing works for me.

https://github.com/npm/npm/wiki/Troubleshooting#error-enoent-stat-cusersuserappdataroamingnpm-on-windows-7

https://github.com/diegonetto/generator-ionic/issues/42

Please guide me, I am totally stuck at that point. Try to removing node js and reinstalling it many times. But nothing goes right.

回答1:

First of all packages warning you, that it requires nodejs 0.10.x and may be that is a reason. Another try you can upgrade npm and try to found new version. So here steps to do it:

npm cache clean
npm update -g npm
npm cache clean


回答2:

Please download Node 0.10.38

I was too having problem with newer version of node.

I have already aswered this in detail https://stackoverflow.com/a/31124491/1276616