admin 管理员组

文章数量: 887021

1.升级node

查看node版本: node -v

windows升级直接在官网下载最新版本安装覆盖就行了:

下载 | Node.js 中文网

以下方法仅适用于linux:

npm install -g n

n stable

2. npm升级

查看npm版本:npm -v

升级:npm install -g npm@8.5.5

版本可参考:以往的版本 | Node.js

版本不匹配会报如下错误:

npm WARN npm npm does not support Node.js v16.15.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.
npm WARN npm You can find the latest version at https://nodejs/
npm ERR! cb.apply is not a function

如果用了匹配的版本还是报错,可以先清除缓存再升级,还不行就只好卸载node,再重装。

本文标签: 环境 Windows npm Node