Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
stage 'CI'
node {
git branch: 'jenkins2-course',
url: 'https://github.com/g0t4/solitaire-systemjs-course'
// pull dependencies from npm
// on windows use: bat 'npm install'
sh 'npm install'
// stash code & dependencies to expedite subsequent testing
// and ensure same code & dependencies are used throughout the pipeline
// stash is a temporary archive
stash name: 'everything',
excludes: 'test-results/**',
includes: '**'
// test with PhantomJS for "fast" "generic" results
// on windows use: bat 'npm run test-single-run -- --browsers PhantomJS'
sh 'npm run test-single-run -- --browsers PhantomJS'
// archive karma test results (karma is configured to export junit xml files)
step([$class: 'JUnitResultArchiver',
testResults: 'test-results/**/test-results.xml'])
}
def notify(status){
emailext (
to: "wesmdemos@gmail.com",
subject: "${status}: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'",
body: """<p>${status}: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':</p>
<p>Check console output at <a href='${env.BUILD_URL}'>${env.JOB_NAME} [${env.BUILD_NUMBER}]</a></p>""",
)
}
@nieal8773
Copy link

nieal8773 commented Sep 9, 2017

Hi,

I am a newbie to Jenkins. I am getting an error while executing.
[solitaire pipeline] Running shell script

  • npm run test-single-run -- --browsers Chrome
    npm ERR! Error: ENOENT, open '/var/lib/jenkins/workspace/solitaire pipeline/node_modules/test-single-run/package.json'
    npm ERR! If you need help, you may report this log at:
    npm ERR! http://github.com/isaacs/npm/issues
    npm ERR! or email it to:
    npm ERR! npm-@googlegroups.com

npm ERR! System Linux 2.6.32-696.3.2.el6.x86_64
npm ERR! command "node" "/usr/bin/npm" "run" "test-single-run" "--" "--browsers" "Chrome"
npm ERR! cwd /var/lib/jenkins/workspace/solitaire pipeline
npm ERR! node -v v0.10.48
npm ERR! npm -v 1.3.6
npm ERR! path /var/lib/jenkins/workspace/solitaire pipeline/node_modules/test-single-run/package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /var/lib/jenkins/workspace/solitaire pipeline/npm-debug.log
npm ERR! not ok code 0

Please let me know what may be the issue. I don't have docker installed

@Humberd
Copy link

Humberd commented Sep 10, 2017

@nieal8773 When you run a command: npm run test-single-run... it internally looks for a file package.json and in your case the ENOENT code says "Cannot find a file or a directory"

@sjonnala
Copy link

sjonnala commented Nov 2, 2019

After updating with parallel execution for the Integration tests, I'm getting this below error. Can anyone plz help to resolve this?

`
npm run test-single-run -- --browsers

solitaire@0.0.0 test-single-run /Users/satishjonnala/.jenkins/workspace/solitaire pipeline
karma start karma.conf.js --single-run "--browsers"
/Users/satishjonnala/.jenkins/workspace/solitaire pipeline/node_modules/karma/lib/config.js:153
throw new TypeError('Invalid configuration: browsers option must be an array')
^TypeError: Invalid configuration: browsers option must be an array
at normalizeConfig (/Users/satishjonnala/.jenkins/workspace/solitaire pipeline/node_modules/karma/lib/config.js:153:11)
at Object.parseConfig (/Users/satishjonnala/.jenkins/workspace/solitaire pipeline/node_modules/karma/lib/config.js:328:10)
at new Server (/Users/satishjonnala/.jenkins/workspace/solitaire pipeline/node_modules/karma/lib/server.js:57:20)
at Object.exports.run (/Users/satishjonnala/.jenkins/workspace/solitaire pipeline/node_modules/karma/lib/cli.js:243:7)
at Object. (/Users/satishjonnala/.jenkins/workspace/solitaire pipeline/node_modules/karma/bin/karma:3:23)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Function.Module.runMain (module.js:694:10)
at startup (bootstrap_node.js:204:16)
at bootstrap_node.js:625:3
`

@IstrateAndrei
Copy link

IstrateAndrei commented Sep 2, 2020

I'm getting this error when I'm trying to build the Module 5 starting point script:
/.jenkins/workspace/Solitare-JS@tmp/durable-12aed822/script.sh: line 1: npm: command not found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment