node 升级到最新稳定版本
一.n stable 报错
'n' is not recognized as an internal or external command,
operable program or batch file.
'n' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
解决方法:
放在node.js的安装目录下
然后打开cmd命令行窗口,输入:gnvm update latest,等待更新。
当然也可以直接覆盖.
二.命令行更新node版本
1.更新node.js版本命令:
npm install -g n
2.升级node.js到最新稳定版
n stable
遇到的错误:
1 、
D:\webpack>npm install -g n
npm ERR! Windows_NT 6.1.7601
npm ERR! argv “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\
node_modules\npm\bin\npm-cli.js” “install” “-g” “n”
npm ERR! node v6.9.2
npm ERR! npm v3.10.9
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for n@2.1.8: 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! Please include the following file with any support request:
npm ERR! D:\webpack\npm-debug.log
解决方案
npm install -g n --force或-f:强制重新安装
2、
D:\webpack>npm install webpack –save-dev
npm ERR! Windows_NT 6.1.7601
npm ERR! argv “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\
node_modules\npm\bin\npm-cli.js” “install” “webpack” “–save-dev”
npm ERR! node v6.9.2
npm ERR! npm v3.10.9
npm ERR! code ENOSELF
npm ERR! Refusing to install webpack as a dependency of itself
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! D:\webpack\npm-debug.log
解决方案:
出现问题是因为:package.json中已经有webpack了,换个名字就行了
参考:https://blog.csdn.net/wxt185/article/details/77322608
赞赏码


非学,无以致疑;非问,无以广识
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!
2021-10-20 Centos 根据端口查看占用进程 根据进程查看占用端口
2021-10-20 Elasticsearch 之Mapping设置
2021-10-20 实战!聊聊PHP如何使用 ElasticSearch 做搜索
2018-10-20 最完美解决Nginx部署ThinkPHP项目的办法
2018-10-20 最完美解决Nginx部署ThinkPHP项目的办法
2018-10-20 nginx 80端口重定向到443端口
2018-10-20 nginx 80端口重定向到443端口