npm 不支持 Node.js v12.18.3 [英] npm does not support Node.js v12.18.3

查看:37
本文介绍了npm 不支持 Node.js v12.18.3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以看到有人问了十几次,但到目前为止我找到的解决方案都没有对我有用.

Can see it's been asked a dozen times but none of the solutions I've found have worked for me so far.

我已经在我的 Windows 10 PC 上安装了最新版本的 Node.js (12.18.3),我正在尝试使用 npm 安装一个包.当我输入 npm -v 时,它返回 5.6.0,在我看来它已经过时了 - 但是当我尝试安装软件包或更新 npm 时,我每次都会收到以下错误:

I've installed the latest version of Node.js (12.18.3) on my Windows 10 PC and I'm trying to install a package using npm. When I input npm -v it comes back with 5.6.0, which to me looks out of date - but when I try and install a package or update npm, I get the following error every time:

npm WARN npm npm does not support Node.js v12.18.3
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/
npm ERR! cb.apply is not a function

npm ERR! A complete log of this run can be found in:

我已经尝试完全卸载 Node.js,删除所有 node_modules 文件夹并在全新安装后重新启动我的计算机,但每次都是一样的.我也试过使用 npm install -g npmnpm install npm@latest -g 但同样,我得到了同样的错误.

I've tried uninstalling Node.js completely, deleting all node_modules folders and restarting my computer after a fresh install, but it's the same thing each time. I've also tried using npm install -g npm and npm install npm@latest -g but again, I get the same error.

这里有什么解决方案吗?

Any solutions here?

推荐答案

我找到了解决方法!

首先你需要打开你的 cmd 行,然后使用 "npm install -g npm@latest "你会得到这样的错误

First you need to open your cmd line, and use " npm install -g npm@latest " you'll get the error like this

C:\Users\KimeruLenovo>npm install -g npm@latest
npm WARN npm npm does not support Node.js v14.7.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/
npm ERR! cb.apply is not a function npm ERR! A complete log of this
run can be found in: npm ERR! 
C:\Users\KimeruLenovo\AppData\Roaming\npm-cache\_logs\2020-08 10T09_36_56_388Z-debug.log

转到可以找到调试日志的路径(该文件在您的 npm-cache 文件夹中)C:\Users\KimeruLenovo\AppData\Roaming

Go to the path where you can find the debug log( this file is found in your npm-cache folder) C:\Users\KimeruLenovo\AppData\Roaming

删除 NPM 和 NPM-Cache 文件夹,但不要重新安装 node .删除后返回您的命令行并重新使用该命令"npm install -g npm@latest "

Delete the NPM and NPM-Cache folder, but DO NOT reinstall node . once deleted go back to your comand line and re-use the command " npm install -g npm@latest "

这应该可以解决问题:)

This should do the trick :)

这篇关于npm 不支持 Node.js v12.18.3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆