node 升级

升级Node后,执行npm install出现以下错误:

DLCM50893462A:user-dashboard i318043$ npm install
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/Cellar/node/5.6.0/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v7.4.0
npm ERR! npm v4.0.5
npm ERR! code MODULE_NOT_FOUND

npm ERR! Cannot find module 'internal/fs'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR! /Users/i318043/z/react/user-dashboard/npm-debug.log
根据“https://github.com/nodejs/node/issues/9377”其中一个回复的描述,大意为需要先为NodeJS,然后安装npm,然后重新升级NodeJS

This worked for me on a Mac:

$ sudo n 6.9.1
$ sudo npm -g install npm@next
$ sudo n stable

$ node -v
v7.2.1
$ npm -v
3.10.10

下面是更新最新Node的方法,不需要像上面那样指定NodeJS的版本号。

https://davidwalsh.name/upgrade-nodejs

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

转载于:https://www.cnblogs.com/wuhjbk/p/9957574.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值