Как избавиться от ошибки «Отказано в доступе» в TeamCity - PullRequest
0 голосов
/ 23 декабря 2019

У меня есть приложение с сценарием 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, но безуспешно. Я много гуглил, но не смог найти решение.

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

Заранее спасибо

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...