Issue
First of all, give thanks for reading my question and try to help me and apologize for my English.
I have a problem when deploying in jenkins.
When I try to deploy it shows me the following error:
[32mInstall complete.
[39m(node:41590) [DEP0026] DeprecationWarning: util.print is deprecated. Use console.log instead.
/var/lib/jenkins/workspace/DESIGNER DEV/node_modules/eslint/lib/source-code/source-code.js:426
return /\s/u.test(text.replace(/\/\*.*?\*\//gus, ""));
^
SyntaxError: Invalid regular expression flags
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:599:28)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/var/lib/jenkins/workspace/DESIGNER DEV/node_modules/eslint/lib/source-code/index.js:4:17)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Module.require (module.js:579:17)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `fontello-cli install --config ./src/styles/components/icons/config.json --css ./src/styles/components/icons/css --font ./src/styles/components/icons/font && mkdir -p ./build && babel ./src/service-worker-designer.js --out-file ./build/service-worker-designer.js && react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
From what I've been looking at it is seen that it is a problem of the eslint version.
Could anyone tell me exactly what to do to fix it and be able to deploy in jenkins?
EDIT: (SOLUTION)
First, I've install svgo: npm install [email protected] -E
And Last, I updated jenkins node version to 8.10
Solution
In my case (node react app), the cause of this error is the depreciated eslint-config-airbnb
npm module. Running npx install-peerdeps --dev eslint-config-airbnb
for npm 5+ works for me. Depending on the version of your npm, if your npm version is <5 then run npm install -g install-peerdeps install-peerdeps --dev eslint-config-airbnb
. Hope this help?
Answered By - Sulaiman Abiodun
Answer Checked By - Senaida (JavaFixing Volunteer)