找不到模块:错误:替换路径后无法解析“@utils/time/time”"/>
npm 调试仍然显示找不到模块:错误:替换路径后无法解析“@utils/time/time”
当我使用这个
npm run start
命令启动项目时,显示错误:
ERROR in ./node_modules/js-wheel/dist/index.js 6:0-58
Module not found: Error: Can't resolve '@auth/extension/AuthHandler' in '/Users/John/source/reddwarf/frontend/ai-web/node_modules/js-wheel/dist'
ERROR in ./node_modules/js-wheel/dist/index.js 7:0-49
Module not found: Error: Can't resolve '@utils/graphic/RdColor' in '/Users/John/source/reddwarf/frontend/ai-web/node_modules/js-wheel/dist'
ERROR in ./node_modules/js-wheel/dist/index.js 8:0-44
Module not found: Error: Can't resolve '@utils/file/RdFile' in '/Users/John/source/reddwarf/frontend/ai-web/node_modules/js-wheel/dist'
我已经替换了
js-wheel
相对路径,运行npm update命令刷新依赖。这是 ./node_modules/js-wheel/dist
中的 index.js 文件,现在看起来像:
import { ResponseHandler } from "./src/net/rest/ResponseHandler";
import { RequestHandler } from "./src/net/rest/RequestHandler";
import { WheelGlobal } from "./src/model/immutable/WheelGlobal";
import { TimeUtils } from "./src/utils/time/time";
import { ResponseCode } from "./src/net/rest/ResponseCode";
import { AuthHandler } from "./src/auth/extension/AuthHandler";
import { RdColor } from "./src/utils/graphic/RdColor";
import { RdFile } from "./src/utils/file/RdFile";
export { ResponseHandler, RequestHandler, WheelGlobal, TimeUtils, ResponseCode, AuthHandler, RdColor, RdFile };
为什么还显示这个错误?我应该怎么做才能解决这个问题?我也尝试清除缓存
npm cache clean --force
并使用npm install
重新安装依赖项,仍然无法工作。
回答如下:
更多推荐
npm 调试仍然显示找不到模块:错误:替换路径后无法解析“@utils/time/time”
发布评论