Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
211 views
in Technique[技术] by (71.8m points)

npm install -g cordova and ionic 2 error

I'm trying to install ionic 2 for some hours and I don't succee. while I'm install cordova by cmd with the command "npm install -g cordova" I get this error

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\Adir\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "-g" "cordova"
npm ERR! node v4.5.0
npm ERR! npm  v3.10.7
npm ERR! path C:UsersAdirAppDataRoaming
pm
ode_modules.stagingabbrev-ed18b12b
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename

npm ERR! enoent ENOENT: no such file or directory, rename 'C:UsersAdirAppDataRoaming
pm
ode_modules.stagingabbrev-ed18b12b' -> 'C:UsersAdirAppDataRoaming
pm
ode_modulescordova
ode_modules
pm
ode_modulesabbrev'
npm ERR! enoent ENOENT: no such file or directory, rename 'C:UsersAdirAppDataRoaming
pm
ode_modules.stagingabbrev-ed18b12b' -> 'C:UsersAdirAppDataRoaming
pm
ode_modulescordova
ode_modules
pm
ode_modulesabbrev'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR!     C:UsersAdir
pm-debug.log
npm ERR! code 1
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

What fixed my problem was I tried unistalling and re-installing node via brew in mac
npm cache clean
brew uninstall --force node
rm -r /usr/local/lib/node_modules
brew install node

Now if you run "which node"
It should /usr/local/bin/node

And now set NODE_PATH in my .bash_profile as
export NODE_PATH=/usr/local/lib/node_modules

After this it gave me no problem what so ever


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...