nodejs version issue when installing express

本秂侑毒 提交于 2019-12-25 02:28:08

问题


Just setting up my raspberry pi as node.js server. Did a clean install of Raspberian

then installed node

if I do node -v it says: v0.10.25

then installed npm

if I do npm --version it says: 1.1.4

if I do then npm install express it fails and as the reason why it says

npm ERR! Required: {"node":">= 0.8.0"} npm ERR! Actual: {"npm":"1.1.4","node":"0.6.19"}

Any idea what I am doing wrong?


回答1:


I used this manual and version 0.11.3 and got success. http://doctorbin.tumblr.com/post/53991508909/how-to-install-the-latest-version-of-nodejs-npm-and




回答2:


Looks like a bad intall of nodejs.

Try to:

Remove nodejs:

sudo apt-get purge nodejs

then, get the python-s-p package:

sudo apt-get update

sudo apt-get install python-software-properties

Add add the chris-lea ppa:

sudo add-apt-repository ppa:chris-lea/node.js

sudo apt-get update

Finally, install again

sudo apt-get install nodejs  

Everything should work fine now.



来源:https://stackoverflow.com/questions/23697946/nodejs-version-issue-when-installing-express

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!