178

i clone a project with git, the project was create with ionic 2 but when i execute the command for re-create the node_modules folder i get this error.

npm install
npm WARN deprecated [email protected]: Please update to the latest object-keys
npm ERR! code ETARGET
npm ERR! notarget No matching version found for ionic-native@^3.5.0
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 'ionic-hello-world'
npm ERR! notarget 

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/wihermes/.npm/_logs/2017-06-02T13_58_47_295Z-debug.log

NOTE: I already update npm.

Does anyone know how to fix it?

1
  • 1
    Same problem now after npm install -g ionic@latest which takes it up to v.3.12.0 ... npm complains that there "is no matching version found", but it's clearly installed. Worked to change package.json to target `"^3.0.0" and then let it install whatever it wanted to. That apparently worked, but it only installed 3.10.3. No idea why the difference, but meh. Commented Oct 1, 2017 at 16:56

21 Answers 21

275

I was having issue for a package which was available. Force cleaning the cache helped.

npm cache clean --force
Sign up to request clarification or add additional context in comments.

8 Comments

Helped as well. Seems like a corrupted cache is the most likely reason for this error on npm v7.
Use sudo before the command.
I have npm 8.1.2 and was trying to install newer version of angualr cli, got an error saying "No matching version found for [email protected].". This command helped.
Without --force I got the message: As of npm@5, the npm cache self-heals from corruption issues by treating integrity mismatches as cache misses. As a result, data extracted from the cache is guaranteed to be valid. But the problem was still fixed by forcing a cache clean! So much for the bold statements in the warning.
For me, just npm cache verify seems to have helped. (Even though its output did not signal anything like a problem would have been found.)
|
95

The version you have specified, or one of your dependencies has specified is not published to npmjs.com

Executing npm view ionic-native versions (see docs) the following output is returned for package versions:

versions:
   [ '1.0.7',
     '1.0.8',
     '1.0.9',
     '1.0.10',
     '1.0.11',
     '1.0.12',
     '1.1.0',
     '1.1.1',
     '1.2.0',
     '1.2.1',
     '1.2.2',
     '1.2.3',
     '1.2.4',
     '1.3.0',
     '1.3.1',
     '1.3.2',
     '1.3.3',
     '1.3.4',
     '1.3.5',
     '1.3.6',
     '1.3.7',
     '1.3.8',
     '1.3.9',
     '1.3.10',
     '1.3.11',
     '1.3.12',
     '1.3.13',
     '1.3.14',
     '1.3.15',
     '1.3.16',
     '1.3.17',
     '1.3.18',
     '1.3.19',
     '1.3.20',
     '1.3.21',
     '1.3.22',
     '1.3.23',
     '1.3.24',
     '1.3.25',
     '1.3.26',
     '1.3.27',
     '2.0.0',
     '2.0.1',
     '2.0.2',
     '2.0.3',
     '2.1.2',
     '2.1.3',
     '2.1.4',
     '2.1.5',
     '2.1.6',
     '2.1.7',
     '2.1.8',
     '2.1.9',
     '2.2.0',
     '2.2.1',
     '2.2.2',
     '2.2.3',
     '2.2.4',
     '2.2.5',
     '2.2.6',
     '2.2.7',
     '2.2.8',
     '2.2.9',
     '2.2.10',
     '2.2.11',
     '2.2.12',
     '2.2.13',
     '2.2.14',
     '2.2.15',
     '2.2.16',
     '2.2.17',
     '2.3.0',
     '2.3.1',
     '2.3.2',
     '2.4.0',
     '2.4.1',
     '2.5.0',
     '2.5.1',
     '2.6.0',
     '2.7.0',
     '2.8.0',
     '2.8.1',
     '2.9.0' ],

As you can see no version higher than 2.9.0 has been published to the npm repository. Strangely they have versions higher than this on GitHub. I would suggest opening an issue with the maintainers on this.

For older versions of npm, the command may be npm view ionic-native (see legacy docs)

For now you can manually install the package via the tarball URL of the required release:

npm install https://github.com/ionic-team/ionic-native/tarball/v3.5.0

4 Comments

Can you tell me about bp-datepicker , i can see version 5.0.6 is the latest but when i try to install it , it only installs 4.0.6 as the letest .
Don't see how this relates back, open a new question please @MasterYoda
We faced this issue in our organization when using Nexus for npm dependencies. The versions for packages were stale, so our workaround is to "Invalidate cache" on the Nexus repository.
As of npm v8, the command now seems to be npm view ionic-native versions.
66

Try removing package-lock.json file first.

2023-10-15 NOTICE:

As other users mentioned this is not a good solution. Use this only as a last resort.

4 Comments

This is no solution at all! Removing the lock file is like updating most packages to the latest known version. In worst case you have no tests within your project. Then you have to check every little functionality manually to verify everything still works fine.
this worked for me whenI got a similar error after I changed the name in package.json
I was trying to install a version that did exist. I confirmed it did exist using npm view. For some reason this worked for me.
It worked for me when I updated node and angular cli version.
17

Try removing package-lock.json and running npm install && npm update, it'll install the latest version and clear all errors.

1 Comment

Removing the lock file is like updating most packages to the latest known version, which may not help rather than create more errors by installing packages which are not backwards compatible
9

In my case I was needed to do the following steps: The 1st step is outdated, so it could be skipped (most probably)

npm cache clean --force
npm cache verify
npm uninstall yourPackage
npm uninstall -g yourPackage

My problem is described here

After these steps the application was generated successfully.

Comments

8

coming from the future to add one point:

Thanks what other people mentioned we have:

  • you should try clearing cache npm cache clean --force
  • and view the versions npm view [pacakgeName] versions

What I wanted to add:

  • if it didn't work, check you registry npm config get registry and make sure it matches this https://registry.npmjs.org/

The last point was my problem, So wanted to mention it in case someone had same problem.

Comments

5

To solve the issue:

Delete your package-lock.json or yarn.lock

Run npm cache clean --force

Then npm install or yarn install again.

1 Comment

Cleaning the cache helped me. There was no package-lock-.json anyways.
3

npm ERR! code ETARGET

npm ERR! notarget No matching version found for vue@next.

npm ERR! notarget In most cases you or one of your dependencies are requesting

npm ERR! notarget a package version that doesn't exist.

I got this error when I tried to install vue on a laravel 10 project with nodejs at v20.11.0

instead of using

npm install vue@next

I used

npm install vue@latest

and this solved the issue !

Comments

2

Removing package-lock.json should be the last resort, at least for projects that have reached production status. After having the same error as described in this question, I found that my package-lock.json was corrupt, even though it was generated. One of the packages had itself as an empty dependency, in this example jsdoc:

        "jsdoc": {
        "version": "x.y.z",
        . . . . . . 
        "dependencies": {
            . . . . . ,
            "jsdoc": {},
            "taffydb": {
             . . . . . 

Please note I have omitted irrelevant parts of the code in this example.

I just removed the empty dependency "jsdoc": {}, and it was OK again.

1 Comment

I had this too - even after running npm install with no package-lock.json ... Had to blow out node_modules and do another npm install to finally get this fixed
2

Probably not the case of everybody but I had the same problem. I was using the last, in my case, the error was because I was using jfrog manage from the company where I am working.

 npm config list

The result was

; cli configs
metrics-registry = "https://COMPANYNAME.jfrog.io/COMPANYNAM/api/npm/npm/"
scope = ""
user-agent = "npm/6.3.0 node/v8.11.2 win32 x64"

; userconfig C:\Users\USER\.npmrc
always-auth = true
email = "XXXXXXXXX"
registry = "https://COMPANYNAME.jfrog.io/COMPANYNAME/api/npm/npm/"

; builtin config undefined
prefix = "C:\\Users\\XXXXX\\AppData\\Roaming\\npm"

; node bin location = C:\Program Files\nodejs\node.exe
; cwd = C:\WINDOWS\system32
; HOME = C:\Users\XXXXXX
; "npm config ls -l" to show all defaults.

I solve the problem by using the global metrics.

1 Comment

I changed the registry back to default, and it worked.
2

try

npm install --force
npm install --legacy-peer-deps

Comments

2

For me the problem was that I issued the command:

npm publish dist

While this other command works:

npm publish dist/

The log was not intuitive.

1 Comment

oh man, this... after wasting hours this did the trick! seems this somewhen changed between older versions of node.js if you user 16 or newer I guess this change is required
1

For those who have already run npm cache clean --force but are still facing issues, please check the list of versions available for the package you are trying to install. You can do this by using the command:

npm view <package> versions.

After running this command, you will see a list of versions for that package. Please compare this list with the one shown on the NPM website.

https://www.npmjs.com/

If you do not see the latest version in that list, you might want to verify which registry you're using. You can check it by running:

npm config get registry.

By default, the npm registry should be:

https://registry.npmjs.org/

If the registry you're using is not the default one, change it by running:

npm config set registry <url>

or

npm config set registry http://registry.npmjs.org/.

Hope this helps.

UPDATE || 17 April 2025

If you are using a registry mirror such as:

https://npmmirror.com/

On the package page, you can click the 进行同步 button to notify npmmirror to update their data. Wait a moment after clicking that button, and npmmirror will provide the latest version. After npmmirror updates their data, you can try running npm install again.

Comments

0

For those experimenting with creating their own packages, make sure that you dont skip a version. For instance, if I have published my-package 1.0.1 & 1.0.3, when I go to install it from elsewhere I will get an error notarget No matching version found for [email protected].

The good news is it is fairly easy to fix, simply 'backfill' the empty version.

  1. edit package.json -> "version": "1.0.2"
  2. npm publish

EDIT: As suggested in comment, clearing the cache will solve the problem locally

  • npm cache clean --force

1 Comment

had the same situation, clearing the cache with npm cache clean --force did the trick as explained below from @Brij
0

Haven't seen it mentionned yet, for me it was my project's .npmrc file that was pointing to the wrong npm registry, as we're using Azure DevOps Package Registry.

Comments

0

I and running a node app with nextjs on the frontend and nestjs on the backend.

What I did was to delete my pnpm-lock.yaml file from my project folder and I was able to get past this error. It did went ahead and re-create this file though.

Comments

0

In my case, I was trying to install yarn@3, running npm view yarn showed version 3 isn't on npm.

Going to the yarn docs for version 3 showed the solution:

corepack prepare yarn@stable --activate
corepack prepare yarn@<version> --activate

Comments

0

Inside your package.json, delete "graphql": "^", and npm install after saving the changes

1 Comment

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
-1

If none of this did not help, then try to swap ^ in "^version" to ~ "~version".

Comments

-2

first, in C:\users\your PC write npm uninstall -g create-react-app then, create your project folder with npx create-react-app folder-name.

Comments

-2

Remove node_modules, cache files (normally are at the top of the folder in your editor) and the package-lock.json, then run npm install.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.