nodejs升级
升级
声明
仅支持Linux版本,且MAC版无法保证
安装
需要安装一个软件n,文档。
1 |
|
如果无法安装,请使用
1 |
|
更新
指定版本号
1 |
|
最新版本
1 |
|
最新稳定版
1 |
|
续
如果n提醒你如下:
Note: the node command changed location and the old location may be remembered in your current shell.
old : /usr/bin/node
new : /usr/local/bin/node
To reset the command location hash either start a new shell, or execute PATH=”$PATH”
那么按提示输入PATH=$PATH
即可
再次检查node -v
,可发现已成功升级。
npm安装
NPM是随同NodeJS一起安装的包管理工具,能解决NodeJS代码部署上的很多问题
出自菜鸟教程
1 |
|
出现版本过低的情况解决方法见下
Node.js安装
默认Linux系统
1 |
|
可能出现版本过低的情况(不得低于10.13.0)
npm WARN npm npm does not support Node.js v10.21.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can’t make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
建议在官网下载nodejs包,然后将包放入/opt/apps
,然后复制链接到/usr/bin
如图`