npm error Cannot find module ‘negotiator‘ 的处理

本想运行npm create vue@latest,但提示:

复制代码
npm error code MODULE_NOT_FOUND
npm error Cannot find module 'negotiator'
npm error Require stack:
npm error - C:\Users\Administrator\AppData\Roaming\nvm\v18.16.1\node_modules\npm\node_modules\tuf-js\node_modules\make-fetch-happen\lib\cache\policy.js
......
npm error A complete log of this run can be found in: C:\Users\Administrator\AppData\Local\npm-cache\_logs\2025-05-27T15_20_48_021Z-debug-0.log

去目录:C:\Users\Administrator\AppData\Roaming\nvm\v18.16.1\node_modules\npm\node_modules\negotiator 中看,确实为空。

通过各种命令,如:npm install -g npm@latest,npm install -g negotiator等,都是提示:Cannot find module 'negotiator'

后面我看到 C:\Users\Administrator\AppData\Roaming\nvm\v18.16.1\node_modules\cnpm\node_modules\npm\node_modules\negotiator 目录中有内容,就把它拷贝到 前面的 npm 目录中,然后再运行各种命令,就正常了。

不知道什么原因造成,只是误打误撞解决了。

相关推荐
前端snow4 小时前
别再死磕单 Agent 了!多智能体架构 + LangGraph 实战,一篇全讲透
前端
IMPYLH4 小时前
HTML 的 <tr> 元素
前端·html
梦想平凡4 小时前
棋牌游戏技术实战(一):用 Node.js 实现房间消息队列、请求幂等与断线恢复
游戏·node.js
行者全栈架构师4 小时前
【鸿蒙心迹】ArkUI 列表性能实战——为什么 200 条数据页面掉到 20fps,LazyForEach 怎么救(HarmonyOS 7.x)
前端·算法·架构
派小心.4 小时前
热力图工具的多页面管理功能怎么比?
前端·数据分析
爱勇宝5 小时前
裁员裁掉了那个干了14年的人:我这才看清职场的5条潜规则
前端·后端·程序员
小天源5 小时前
GEO 品牌监测系统实战:基于 Node.js + Playwright 实现多平台采集与报告导出
人工智能·node.js·geo·品牌检测·ai诊断
Hilaku5 小时前
GraphQL 在国内为什么水土不服?
前端·javascript·程序员
Latchh5 小时前
PDF打开不要密码却显示已加密,前端怎么判断
前端·图像处理·人工智能·计算机视觉·pdf
秋天的一阵风5 小时前
🧐 为什么大厂 RAG 从不用纯向量检索?
前端·面试·ai编程