node.js npm 版本不匹配问题

报错:

mbp:dd248 jooyzhao$ npm install frida

ERROR: npm v10.2.4 is known not to run on Node.js v14.21.3. This version of npm supports the following node versions: `^18.17.0 || >=20.5.0`. You can find the latest version at https://nodejs.org/.

ERROR:

/Users/jooyzhao/.nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/@npmcli/agent/lib/agents.js:105

options.lookup ??= this.#options.lookup

^^^

SyntaxError: Unexpected token '??='

at wrapSafe (internal/modules/cjs/loader.js:1029:16)

at Module._compile (internal/modules/cjs/loader.js:1078:27)

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)

at Module.load (internal/modules/cjs/loader.js:979:32)

at Function.Module._load (internal/modules/cjs/loader.js:819:12)

at Module.require (internal/modules/cjs/loader.js:1003:19)

at require (internal/modules/cjs/helpers.js:107:18)

at Object.<anonymous> (/Users/jooyzhao/.nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/@npmcli/agent/lib/index.js:7:15)

at Module._compile (internal/modules/cjs/loader.js:1114:14)

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)

mbp:dd248 jooyzhao$ node -v

v14.21.3

翻译:

npm当前版本为,node当前版本为,两者不兼容。

解决办法:

卸载node后重装

相关推荐
一个很帅的帅哥10 小时前
实现浏览器的下拉加载功能(类似知乎)
开发语言·javascript·mysql·mongodb·node.js·vue·express
chen序员14 小时前
如何切换淘宝最新镜像源(npm)【2024版】
npm
Bang邦14 小时前
使用nvm管理Node.js多版本
前端·node.js·node多版本管理
新知图书14 小时前
Node.js快速入门
node.js
FakeOccupational16 小时前
nodejs 007:错误npm error Error: EPERM: operation not permitted, symlink
前端·npm·node.js
亦舒.16 小时前
JSDelivr & NPM CDN 国内加速节点
前端·npm·node.js
代码搬运媛16 小时前
code eintegrity npm err sha512
前端·npm·node.js
猿来如此呀19 小时前
运行npm install 时,卡在sill idealTree buildDeps没有反应
前端·npm·node.js
hw_happy20 小时前
解决 npm ERR! node-sass 和 gyp ERR! node-gyp 报错问题
前端·npm·sass
八了个戒1 天前
Koa (下一代web框架) 【Node.js进阶】
前端·node.js