解决node与npm版本不一致,出现npm WARN npm npm does not support Node.js v15.14.0

2022/2/2 22:42:38

本文主要是介绍解决node与npm版本不一致,出现npm WARN npm npm does not support Node.js v15.14.0,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

出现node与npm版本不一致
今天我升级了node之后,出现的了如下信息
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 6, 8, 9, 10, 11, 12.
npm WARN npm You can find the latest version at https://nodejs.org/

查找对应的版本信息

通过这个网址,查看了对应的版本信息
https://blog.csdn.net/qq_36369047/article/details/109247734
我的node版本对应的npm是 7.7.6
执行 npm -g install npm@7.7.6

执行 npm -g install npm@7.7.6 出现的又一个问题

C:\Users\user>npm -g install npm@7.7.6
npm WARN npm npm does not support Node.js v15.14.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 6, 8, 9, 10, 11, 12.
npm WARN npm You can find the latest version at https://nodejs.org/
npm ERR! code EPERM
npm ERR! syscall mkdir
npm ERR! path C:\Program Files\nodejs\node_modules\.staging
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.staging'
npm ERR!  [OperationalError: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.staging'] {
npm ERR!   cause: [Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.staging'] {
npm ERR!     errno: -4048,
npm ERR!     code: 'EPERM',
npm ERR!     syscall: 'mkdir',
npm ERR!     path: 'C:\\Program Files\\nodejs\\node_modules\\.staging'
npm ERR!   },
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: 'C:\\Program Files\\nodejs\\node_modules\\.staging'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user\AppData\Roaming\npm-cache\_logs\2022-02-02T14_06_49_347Z-debug.log

出现这个问题的原因是

这说明npm存在旧的npm缓存,还是旧的npm 环境。
我将 C:\Users\user\AppData\Roaming下的 npm、npm-cache两个文件删除

删除后重新执行  npm -g install npm@7.7.6
最后完美解决

尾声

如果你觉得我写的不错的话,可以给我推荐、打赏、评论!
上一个给我打赏的小伙伴都已经找到女朋友了!
咦!你不信,不信你给我打赏看一下!
保准你追到到喜欢的Ta!
你不会追,哎!难受。

我教你,你可以这样说:
小生不才,斗胆-问,不知姑娘是否心系他人。
感情之事,在下不敢儿戏!
如若姑娘早已心系他人。那在下便不再打扰。
如若有所唐突还望姑娘多加体谅!
若姑娘非我良人,那在下就不庸人自恼。
在下怕越陷越深,还望姑娘尽早告知!话已至此,我便先在此谢过!
拿去不谢!回头告诉我结果啊!
咦!抓住一个没有打赏的小伙伴!


这篇关于解决node与npm版本不一致,出现npm WARN npm npm does not support Node.js v15.14.0的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程