如何忽略 npm 运行 错误并继续使用 Travis-CI?
How to ignore npm run errors and keep going on Travis-CI?
我在 Travis 配置中有启动 npm run build
的阶段,其中构建是转换 ts -> js 的脚本。在本地,它 returns 两个无关紧要的错误,无论如何我可以 运行 一个服务器。但是,这些错误阻止了 Travis 继续前进并失败了。
- stage: "Build front"
before_script:
- cd front
- npm install
- npm run build
错误:
...
[0] npm run build:client exited with code 0
build/setupProdServer.ts(6,20): error TS2307: Cannot find module '../src/vue-ssr-server-bundle.json'.
build/setupProdServer.ts(7,28): error TS2307: Cannot find module '../src/vue-ssr-client-manifest.json'.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
...
我试过添加
allow-failures:
- node
- npm
并没有帮助。
我需要 Travis 忽略这些错误并进入下一阶段。
Travis中什么样的命令或参数可以解决?
只需添加|| true
:
- npm run build || true
我在 Travis 配置中有启动 npm run build
的阶段,其中构建是转换 ts -> js 的脚本。在本地,它 returns 两个无关紧要的错误,无论如何我可以 运行 一个服务器。但是,这些错误阻止了 Travis 继续前进并失败了。
- stage: "Build front"
before_script:
- cd front
- npm install
- npm run build
错误:
...
[0] npm run build:client exited with code 0
build/setupProdServer.ts(6,20): error TS2307: Cannot find module '../src/vue-ssr-server-bundle.json'.
build/setupProdServer.ts(7,28): error TS2307: Cannot find module '../src/vue-ssr-client-manifest.json'.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
...
我试过添加
allow-failures:
- node
- npm
并没有帮助。
我需要 Travis 忽略这些错误并进入下一阶段。
Travis中什么样的命令或参数可以解决?
只需添加|| true
:
- npm run build || true