Npm version problem

PS C:\Users\rwobb\Local Sites\learningplugins\app\public\wp-content\plugins> npx @wordpress/create-block@latest preset-block-bindings --template @block-developer-cookbook/preset-block-bindings
Minimum system requirements not met!

Error: Wanted npm version >=10.2.3 (>=10.2.3)

The program may not complete correctly if you continue.

:check_mark: Are you sure you want to continue anyway? No
Cancelled.

To install npm, run npm install -g npm@>=10.2.3
PS C:\Users\rwobb\Local Sites\learningplugins\app\public\wp-content\plugins> npm --version
11.2.0

According to me version 11 is newer then 10.x so I do not understand the error message

Hey @rwobben! Sometimes, tools like npx or npm can get hung up on old versions or cache. You can try clearing the npm cache with this command:

npm cache clean --force

If you’re still having problems, could you provide some more details to help us take a further look?

  • What is your OS?

  • What version of Local are you on?

  • Please attach a copy of your Local Logs

Keep us posted and we’d be happy to help further!

That did the trick
But then I do not understand this message:

PS C:\Users\rwobb\Local Sites\learningplugins\app\public> npm --version
10.2.3
PS C:\Users\rwobb\Local Sites\learningplugins\app\public> npx @wordpress/create-block@latest preset-block-bindings --template @block-developer-cookbook/preset-block-bindings
Minimum system requirements not met!

Error: Wanted npm version >=10.2.3 (>=10.2.3)

The program may not complete correctly if you continue.

? Are you sure you want to continue anyway? (y/N)

version is equal or more then 10.2.3 so why is npx still buggging about it

OS : Windows 10 pro
Local version : Version 9.2.2+6771

Local logs :

error.log (20.6 KB)

Hi @rwobben

Glad to hear clearing the cache fixed the issue!

While version 11 is technically greater than 10.2.3, it seems that either the package or tool was incorrectly flagging the version range or had cached incorrect version data. Clearing the cache was a good first step to resolve this. If it happens again, checking for package-specific updates or bugs related to version requirements might help clarify what’s going on.

oke,

But with version 10.2.3 it seems that the package flagged the version range wrong and clearing the cache does not solve the problem.

Any ideas left to solve this problem ?

Sorry @rwobben I was confused. You said that clearing the cache solved the problem initially but you’re still running into the problem with each attempt then?

yes I am and the same error appears

Error: Wanted npm version >=10.2.3 (>=10.2.3)

The program may not complete correctly if you continue.

✔ Are you sure you want to continue anyway? No
Cancelled.

To install npm, run `npm install -g npm@>=10.2.3`
PS C:\Users\rwobb\Local Sites\learningplugins\app\public> npm --version
10.2.3

Even wierder now
I wants to install 10.2.3 where it is already installed

@rwobben You might have multiple Node.js versions installed and differing PATHs in your environments. If you run these three commands, do you see different versions between the first command output and the later two?

npx check-node-version --print

npm --version
node --version

If you see differing versions, you could try adjusting your system path for Node.js or otherwise clean up the extra Node.js installs. @wordpress/create-block uses check-node-version for its “minimum requirements not met” logic, and that library spawns node --version in a subprocess that may not be the same as your current environment if you have multiple Node.js versions or differing paths.

If you don’t see differing versions or if the above doesn’t help, you could try filing an issue against the @wordpress/create-block parent repo as others have done in the past. The warnings you’re seeing ultimately come from that package and not from npm, Node.js or Local.

1 Like

We found rhe culprit
First command gives me :

npm: 8.19.4 

where npm -- version gives me 10.2.3

Now time to find out where that very old one is hiding itself

1 Like

Aha, that would explain the error!

Now time to find out where that very old one is hiding itself

You could try:

npx -c "where node"
npx -c "node --version"

If that gives you a different path and version from where node and node --version (without the npx -c prefix), it could point you to your old version.

Ideally you want npx -c "where node" and where node to give you the same path to avoid problems like you’ve seen here where Node.js launched in a subprocess uses a different version.

1 Like

Did some investigation and it looks like Local is somewhere hiding a 8,x version of npm which bugs me the whole time

Did you find the path or final location? Or just that it’s tied to Local?

as far as I can see it it tied to local

Could you send a screenshot showing this or what you’re seeing on your end?

1 Like

What do you mean.

I concluded the old version is from local because when i uninstalled local the error message disappear.

So when you reinstall Local the error message comes back?

That is what I see. When I use local the error messages appear

Did you try running the commands here to see where exactly it’s showing up at?

If not could you try that and then send us a screenshot of what you see?

here a screenshot

I hope this is what you asked for