首页IT科技怎么升级node(【node】升级 Node 版本教程)

怎么升级node(【node】升级 Node 版本教程)

时间2025-09-19 12:05:39分类IT科技浏览5196
导读:Window 系统 window系统升级node只能到node官网下载window安装包来覆盖之前的node。 node 安装教程附下载地址:https://blog.csdn.net/qq_45677671/article/details/114535955...

Window 系统

window系统升级node只能到node官网下载window安装包来覆盖之前的node                。 node 安装教程附下载地址:https://blog.csdn.net/qq_45677671/article/details/114535955 因为 n 模块是不支持window系统: PS C:\Users\liuxing> npm install -g n npm ERR! code EBADPLATFORM npm ERR! notsup Unsupported platform for n@9.0.0: wanted {"os":"!win32","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm ERR! notsup Valid OS: !win32 npm ERR! notsup Valid Arch: any npm ERR! notsup Actual OS: win32 npm ERR! notsup Actual Arch: x64 npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\liuxing\AppData\Roaming\npm-cache\_logs\2022-11-03T09_24_21_102Z-debug.log

Mac 或 Linux系统

升级方法:以下命令如果提示没权限                ,请在命令的前面加上sudo                        ,如sudo npm install n -g 先清除npm缓存: npm cache clean -f 安装node版本管理工具n; npm install n -g 查看node 所有版本 npm view node versions 升级node版本 # 升级到指定的版本:n 版本号 n 16.0.0 # 升级到最新的稳定版本 n stable # 升级到最新版本        ,不推荐 n latest 使用node -v查看node版本            ,如果版本号改变为你想要的则升级成功                        。 node -v 16.0.0 如果版本号没变                        ,可以重启机器或者尝试以下方法 查看通过n安装的node的位置 which node /usr/local/n/versions/node/16.0.0 进入该位置 cd /usr/local/n/versions/node 编辑/etc/profile vim /etc/profile 将node安装的路径            ,添加到文件末尾; export NODE_HOME=/usr/local/n/versions/node/16.0.0 export PATH=$NODE_HOME/bin:$PATH 输入wq退出保存文件        ,再编译/etc/profile; source /etc/profile 重新查看版本号 node -v 16.0.0
声明:本站所有文章                        ,如无特殊说明或标注                ,均为本站原创发布        。任何个人或组织    ,在未征得本站同意时                        ,禁止复制                、盗用                        、采集        、发布本站内容到任何网站            、书籍等各类媒体平台            。如若本站内容侵犯了原著者的合法权益                    ,可联系我们进行处理                        。

创心域SEO版权声明:以上内容作者已申请原创保护,未经允许不得转载,侵权必究!授权事宜、对本内容有异议或投诉,敬请联系网站管理员,我们将尽快回复您,谢谢合作!

展开全文READ MORE
织梦怎么调用当前栏目下的文章(DEDECMS织梦调用某个作者在某个栏目发布的文章列表)