Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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

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

1 Answer

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...