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后重装

相关推荐
Hi~晴天大圣19 小时前
npm使用介绍
前端·npm·node.js
m0_535817551 天前
macOS下Claude Code从0到1配置教程(附API密钥获取+常见报错修复)
gpt·macos·node.js·api·claude·claudecode·88api
用户357085028811 天前
我做了一个自动生成项目入门文档的 CLI 工具
node.js
云水一下1 天前
模块系统与 npm——万物皆模块
前端·npm·node.js
wgc2k1 天前
Node.js游戏服务器项目移植 4-MongoDB的移植
mongodb·游戏·node.js
meilindehuzi_a1 天前
Node.js × 大模型:AIGC 工程化基础与异步流控总结
node.js·aigc
不好听6132 天前
Node.js 工程化开发流程 — 知识点总结
javascript·node.js
HjhIron2 天前
🚀 从零开始,用 Node.js 构建你的第一个 AIGC 项目
node.js·aigc
To_OC2 天前
我调用 DeepSeek API 连踩 3 个坑,终于把 Node AIGC 开发的核心知识点捋顺了
后端·node.js·aigc