npm WARN config global
--local are deprecated. Use
Error: Cannot find module ‘semver’
Hi , I am getting the node and npm version on my local computer but on jenkins i am only getting the node version , where as for npm version its showing the above error.
I checked with the global variables and also configured Node Installations in Tools .
Please suggest some ideas to resolve this error … Thanks in advance for the suggestions
Hello @bling and welcome to this community
I’m not an expert on
npm at all, to say the truth, for me it’s always a pain in the neck to use it.
The error message you provided seems to indicate that there is a missing module called
semver in your Jenkins environment.
If you have access to your agent, first update
npm install -g npm@latest
Then check is npm is installed where your pipeline expects it to be:
Then you could go with the install of
npm cache clean --force
npm install semver
in your project repo, or
npm install -g semver
to get it installed globally.