Reputation: 311
I try to create CI for my npm module, but I have the problem with NPM install command. I try to globally install gyp but nothing works for me. Is it problem with dependencies (package.json file is added after console output) or some configurations on jenkins is missing? Node version is 11.6.0.
Console output :
gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack at getNotFoundError (/var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/current_node/lib/node_modules/npm/node_modules/which/which.js:13:12)
gyp ERR! stack at F (/var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/current_node/lib/node_modules/npm/node_modules/which/which.js:68:19)
gyp ERR! stack at E (/var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/current_node/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack at /var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/current_node/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack at /var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/current_node/lib/node_modules/npm/node_modules/isexe/index.js:42:5
gyp ERR! stack at /var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/current_node/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
gyp ERR! stack at FSReqCallback.oncomplete (fs.js:160:21)
gyp ERR! System Linux 4.9.0-8-amd64
gyp ERR! command "/var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/current_node/bin/node" "/var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/current_node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /var/jenkins_home/workspace/defined-id/defined-id/node_modules/bufferutil
gyp ERR! node -v v11.6.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN [email protected] No description
npm WARN The package js-sha256 is included as both a dev and production dependency.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /var/jenkins_home/.npm/_logs/2019-03-19T08_59_17_472Z-debug.log
Build step 'Execute shell' marked build as failure
Finished: FAILURE
Package.json
{
"name": "defined-id",
"version": "1.0.0",
"description": "",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"test": "jest --config jestconfig.json",
"build": "tsc",
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
"lint": "tslint -p tsconfig.json",
"prepare": "yarn run build",
"prepublishOnly": "yarn test && yarn run lint",
"preversion": "yarn run lint",
"version": "yarn run format && git add -A src",
"postversion": "git push && git push --tags"
},
"repository": {
"type": "git"
},
"author": "Geens NPO",
"license": "ISC",
"devDependencies": {
"@types/jest": "^23.3.9",
"jest": "^23.6.0",
"js-sha256": "^0.9.0",
"prettier": "^1.15.2",
"ts-jest": "^23.10.5",
"ts-node": "^8.0.3",
"tslint": "^5.11.0",
"tslint-config-prettier": "^1.16.0",
"typescript": "^3.1.6"
},
"dependencies": {
"@types/node": "^10.12.18",
"@types/uuid": "^3.4.4",
"base-58": "0.0.1",
"base58check": "^2.0.0",
"create-hmac": "^1.1.7",
"js-sha256": "^0.9.0",
"jsonld": "^1.4.0",
"key-encoder": "^1.1.7",
"nem2-sdk": "0.10.2",
"ripemd160": "^2.0.2",
"tweetnacl": "^1.0.1",
"tweetnacl-util": "^0.15.0"
}
}
Execute shell :
npm install --prefix defined-id
npm run build --prefix defined-id
npm run test --prefix defined-id
Upvotes: 2
Views: 4782
Reputation: 16574
I suspect that is not a Jenkins error.
Execute the following line in the Linux where NPM commands are executed:
sudo apt-get install build-essential
And build again your Jenkins job.
Upvotes: 6