51工具盒子

依楼听风雨
笑看云卷云舒,淡观潮起潮落

npm run build 在windows 和mac 没问题 在linux 上报错

Vue 部署服务器打包报错,本地可以问题_vue mac打包报错 window打包不报错-CSDN博客

背景:

问题背景是这样的,我们用Vue搭建项目,在我Mac os和前端同事Windows 上执行npm run build 都没有问题,运维同学打包执行npm run build却报错,找不到文件.

Could not resolve "./component/BeforeMessageList/BeforeMessageList.tsx" from "src/pages/assistant/AssistantPage.tsx"
file: /nodejs/kattgattAIAssistant/src/pages/assistant/AssistantPage.tsx
error during build:
RollupError: Could not resolve "./component/BeforeMessageList/BeforeMessageList.tsx" from "src/pages/assistant/AssistantPage.tsx"
    at error (file:///nodejs/kattgattAIAssistant/node_modules/rollup/dist/es/shared/parseAst.js:337:30)
    at ModuleLoader.handleInvalidResolvedId (file:///nodejs/kattgattAIAssistant/node_modules/rollup/dist/es/shared/node-entry.js:17967:24)
    at file:///nodejs/kattgattAIAssistant/node_modules/rollup/dist/es/shared/node-entry.js:17927:26

解决:

MacOS和WIndows都是大小写不敏感,LInux大小写敏感,项目不规范,有些大小写引用没注意。

修改前

赞(1)
未经允许不得转载:工具盒子 » npm run build 在windows 和mac 没问题 在linux 上报错