I have setup an AWS Codepipeline.
The pipeline uses Git as a source, Jenkins for testing and an EC2 instance for deployment.
The project is based on Angular Starter by Angular Class. Thus, it uses Karma for unit testing.
The Jenkins service runs on Ubuntu 16.04.
Karma uses Headless Chrome for testing.
The problem is that I currently get the folloing error when running the tests on Jenkins:
[31m07 05 2017 14:30:35.779:ERROR [karma]: [39m{ Error: spawn EACCES
at exports._errnoException (util.js:1050:11)
at ChildProcess.spawn (internal/child_process.js:319:11)
at exports.spawn (child_process.js:378:9)
at spawnWithoutOutput (/var/lib/jenkins/workspace/ExampleTask/node_modules/karma/lib/launchers/process.js:168:24)
at Object.ProcessLauncher._execCommand (/var/lib/jenkins/workspace/ExampleTask/node_modules/karma/lib/launchers/process.js:76:21)
at Object.ProcessLauncher._start (/var/lib/jenkins/workspace/ExampleTask/node_modules/karma/lib/launchers/process.js:33:10)
at Object.<anonymous> (/var/lib/jenkins/workspace/ExampleTask/node_modules/karma/lib/launchers/process.js:19:10)
at emitOne (events.js:101:20)
at Object.emit (events.js:191:7)
at Object.BaseLauncher.start (/var/lib/jenkins/workspace/ExampleTask/node_modules/karma/lib/launchers/base.js:42:10)
at Object.j (/var/lib/jenkins/workspace/ExampleTask/node_modules/karma/lib/launcher.js:116:17)
at Object.setTimeout.bind.j (/var/lib/jenkins/workspace/ExampleTask/node_modules/qjobs/qjobs.js:143:18)
at ontimeout (timers.js:386:14)
at tryOnTimeout (timers.js:250:5)
at Timer.listOnTimeout (timers.js:214:5) code: 'EACCES', errno: 'EACCES', syscall: 'spawn' }
I have already done some research with the following findings:
- other people also had similar errors but related to to other packages
- the error may be related to wrong permissions
What I have tried so far:
- checking the permissions of /var/lib/jenkins/workspace/ExampleTask -> result: owner is jenkins user
- give jenkins user root privileges (I know it is dangerous but I just wanted to try if it would work) -> result: error still exists
- allow jenkins user to run scripts with sudo -> result: nvm, npm and node is not defined; I tried to install nvm, npm and node manually but got a new error
permission denied /root/.nvm
via mian
No comments:
Post a Comment