- mac 系统需要切换到root用户 sudo -u
查看版本
npm -v
node -v
更新npm版本
npm install -g npm
更新node版本
- 先清除npm缓存:npm cache clean -f
- 然后安装n模块:npm install -g n
安装n时报错解决方案
如何升级nodejs版本 安装n模块报错 npm ERR! notsup Unsupported platform
如何升级nodejs版本
首先安装n模块,
输入npm install -g n
n模块专门用来管理nodejs的版本。
如果出现npm ERR! notsup Unsupported platform for n@2.1.8: wanted {"os":"!win32","arch":"any"} (current: {"os":"win32","arch":"x64"})
这样错误信息,在命令后面加上 --force 重新运行
- 升级node.js到最新稳定版:n stable