Remix开发工具出现导入错误,但导入的包实际存在
Remix开发工具依赖导入错误求助
运行Remix应用时遇到以下来自remix dev tools的错误,我检查了错误中指定的两个文件路径,确认它们都存在且应该能正常工作:
Cannot find package '<project path>\node_modules\.pnpm\remix-development-tools@4.2.2_@remix-run+react@2.11.1_react-dom@18.3.1_react@18.3.1__react@18_jowj2r5lamytlrfivyqi2kheeq\node_modules\react-diff-viewer-continued\package.json' imported from <project path>\node_modules\.pnpm\remix-development-tools@4.2.2_@remix-run+react@2.11.1_react-dom@18.3.1_react@18.3.1__react@18_jowj2r5lamytlrfivyqi2kheeq\node_modules\remix-development-tools\dist\client.js Did you mean to import "react-diff-viewer-continued/lib/src/index.js"?
我已经尝试过以下操作:
- 卸载并重新安装
node_modules和pnpm-lock.yaml - 在
.npmrc中设置auto-install-peers为true - 执行
pnpm config set auto-install-peers true
这个错误是在从仓库拉取部分包更新后突然出现的,只有我的计算机有这个问题,其他项目成员都正常。我试过回退到项目旧版本,还是遇到同样的错误。
我的环境信息:
- 编辑器:VS Code
- 包管理器:pnpm
- 操作系统:Windows
- npm版本:10.7.0
- pnpm版本:9.6.0
内容的提问来源于stack exchange,提问作者Dante Clarenson
相关产品推荐
相关产品推荐

