如何摆脱TeamCity中的“权限被拒绝”错误

时间:2019-12-23 09:08:52

标签: docker teamcity eslint

我在lint文件中使用package.json脚本来响应应用程序:

{
   ...,
   scripts: {
    "lint": "eslint src/"
   }
}

我已将构建添加到TeamCity,它将使用以下选项运行此脚本:

Runner type: Command Line,
Run: Custom Script, 
Custom script:
   rm -rf node_modules
   npm install
   npm run lint
Run step within Docker container: node:latest
Docker image platform: Linux

但是此步骤运行时出现错误sh: 1: eslint: Permission denied。我尝试将使用chmod的访问权限添加到node_modules,但是没有运气。我已经在Google上搜索了很多,但找不到解决方案。

UPD 完整登录TeamCity:

[11:12:13][Step 2/2] 
[11:12:13][Step 2/2] > @siren/app@1.0.0 lint /opt/buildagent/work/d517340ad681961
[11:12:13][Step 2/2] > eslint src/
[11:12:13][Step 2/2] 
[11:12:13][Step 2/2] sh: 1: eslint: Permission denied
[11:12:13][Step 2/2] npm ERR! code ELIFECYCLE
[11:12:13][Step 2/2] npm ERR! errno 126
[11:12:13][Step 2/2] npm ERR! @siren/app@1.0.0 lint: `eslint src/`
[11:12:13][Step 2/2] npm ERR! Exit status 126
[11:12:13][Step 2/2] npm ERR! 
[11:12:13][Step 2/2] npm ERR! Failed at the @siren/app@1.0.0 lint script.
[11:12:13][Step 2/2] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[11:12:13][Step 2/2] 
[11:12:13][Step 2/2] npm ERR! A complete log of this run can be found in:
[11:12:13][Step 2/2] npm ERR!     /root/.npm/_logs/2019-12-23T08_12_13_723Z-debug.log
[11:12:14][Step 2/2] Process exited with code 126
[11:12:14][Step 2/2] Process exited with code 126 (Step: Lint CI (Command Line))
[11:12:14][Step 2/2] Step Lint CI (Command Line) failed

预先感谢

0 个答案:

没有答案