简体   繁体   English

Bamboo 构建失败,因为 webpack dones 找不到 node_modules

[英]Bamboo build fails because webpack donesn't find node_modules

I have configured my project on angular 1.7 with webpack.我已经使用 webpack 在 angular 1.7 上配置了我的项目。 In local when I run the task npm run build (launchin webpack) everything goes correctly.在本地,当我运行任务 npm run build (launchin webpack) 时,一切正常。

But I have a plan for my CI bamboo and when a run the NPM task with npm run build I got a message, which said:但是我对我的 CI 竹子有一个计划,当使用 npm run build 运行 NPM 任务时,我收到一条消息,其中说:

Error: Cannot find module './yargs'

I have the intuition that webpack is not able to reach the node_modules or is not in current directory.我的直觉是 webpack 无法访问 node_modules 或不在当前目录中。

But node_modules is installed and yargs is there after making the npm install task before.但是 node_modules 已安装,并且 yargs 在之前执行 npm install 任务后就在那里。

if I run a script before the npm run build with just "ls -l" command I get:如果我在 npm run build 之前使用“ls -l”命令运行脚本,我会得到:

node_modules
package-lock.json
package.json
src
webpack.config.js

So the folder is there.所以文件夹就在那里。

Any idea where I can take a look?知道在哪里可以看看吗?

I found the solution for the issue.我找到了该问题的解决方案。 In the Source code checkout configuration the "Force clean build" has been checked and now the build succed.在源代码检出配置中,“强制清理构建”已被选中,现在构建成功。

I'm not sure why, but there must have been a conflict with a previous node_modules.我不知道为什么,但一定与之前的 node_modules 有冲突。

The spelling of the file that you're referring is case-sensitive when building via bamboo通过竹子构建时,您所指文件的拼写区分大小写

building locally wouldn't give you any error nor warnings in the console.在本地构建不会在控制台中给您任何错误或警告。

I encountered this issue with a local file (not a node_module)... Hoping this would help someone in the future;我在使用本地文件(不是 node_module)时遇到了这个问题……希望这会在将来对某人有所帮助;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM