npm failing with error code ETARGET when trying to install dependencies

Viewed 1897

Edit

To anyone coming here from the future, run npm get registry and make sure it's pointing to https://registry.npmjs.com.

Mine was pointing to a Nexus registry that temporarily didn't have the package I needed.


I have a basic project that a Jenkins job clones the repository of and runs,

npm install && npm run build

Eventually, it fails with the below error:

npm ERR! code ETARGET
npm ERR! notarget No matching version found for @typescript-eslint/experimental-utils@4.14.1.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget 
npm ERR! notarget It was specified as a dependency of '@typescript-eslint/eslint-plugin'
npm ERR! notarget 

npm ERR! A complete log of this run can be found in:

The version that is being requested exists.

I've tried everything I could think of. I tried,

  • omitting my yarn.lock file
  • switching to package-lock.json to see if that was the issue
  • omitting the package-lock.json
  • running rm -rf node_modules && rm -rf yarn.lock && npm cache clean --force && npm install && npm run build
  • adding @typescript-eslint/experimental-utils@4.14.1 to my dependencies in package.json

What's weird is that locally running yarn && yarn start or npm install && npm run start works just fine.

I honestly have no idea what I'm missing here, I've been pulling my hair out for hours.

I've looked at countless solutions online, but none worked for me.

$ npm -v
v6.13.4
$ node -v
v12.16.1
0 Answers
Related