github 操作 - npm 安装失败并退出代码 1

Kri*_*hna 3 github npm github-actions

我正在尝试使用 github 操作将我的 npm 应用程序部署到 azure。运行 npm install 时出现错误,退出代码为 1.v 这是抛出的错误...

 npm install, build, and test5s
##[error]Process completed with exit code 1.

> ejs@3.1.3 postinstall /home/runner/work/readbetter/readbetter/node_modules/ejs
> node --harmony ./postinstall.js

npm notice created a lockfile as package-lock.json. You should commit this file.
added 133 packages from 70 contributors and audited 133 packages in 3.913s

1 package is looking for funding
  run `npm fund` for details

found 0 vulnerabilities


> readbetter@1.0.0 test /home/runner/work/readbetter/readbetter
> echo "Error: no test specified" && exit 1

npm ERR! code ELIFECYCLE
Error: no test specified
npm ERR! errno 1
npm ERR! readbetter@1.0.0 test: `echo "Error: no test specified" && exit 1`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the readbetter@1.0.0 test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2020-06-20T13_55_32_078Z-debug.log
##[error]Process completed with exit code 1.
Run Code Online (Sandbox Code Playgroud)

可能是什么原因?

这是回购协议。 https://github.com/galdiatorocks/readbetter.git

Rog*_*ier 7

如果你看看你的,package.json你确实"test": "echo \"Error: no test specified\" && exit 1",在那里。因此,如果您尝试运行测试,就会遇到该错误。

要解决这个问题,您需要要么不运行测试,要么需要设置适当的测试。

而且,只要跑步就npm install可以很好地工作:)