npm run cmd fails while cmd on command line works

泄露秘密 提交于 2019-12-03 11:50:43

Don't exit with a non-zero error code unless you really mean it. Except for uninstall scripts, this will cause the npm action to fail, and potentially be rolled back. If the failure is minor or only will prevent some optional features, then it's better to just print a warning and exit successfully.

From https://www.npmjs.org/doc/misc/npm-scripts.html

Use:

node_modules/.bin/jshint .; true

Or write a wrapper that calls jshint and then ignores the exit code and exits successfully with a exit code of zero.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!