Npm version problem

@rwobben I don’t see anything in the screenshot that shows that either version of Node.js is related to Local. Local doesn’t add node.exe or npm.exe to Windows paths.

The only path to Node.js in your screenshot is C:\Program Files\nodejs\node.exe, which is the system-installed version of Node.js and seems to be version 22.14. I don’t see the path for the older version of Node.js in your output.

You could try this to see if it gives you a different Node.js path:

npx -y node -p "process.execPath"

If that does not work, though, you could try reporting this issue to the create-block parent repo, as the underlying problem relates to how create-block detects Node.js/npm versions.

1 Like

Then I see this as output

npx -y node -p "process.execPath"
C:\Users\rwobb\AppData\Local\npm-cache\_npx\1838e33cf768caf6\node_modules\node\bin\node.exe

Thanks for that, @rwobben.

C:\Users\rwobb\AppData\Local\ is not specific to the Local app. Windows itself uses this path named “Local” for locally installed applications, but I can see how you might have thought this relates to Local!

It looks like you might have another version of node installed globally via npm? That could explain why check-node-version shows a different version to your system Node.js.

You could try uninstalling that version with:

npm uninstall -g node

Then run this again:

npx check-node-version --print

If that now shows the correct version of Node.js and npm (the one matching npm --version), try your create-block command again:

npx @wordpress/create-block@latest preset-block-bindings --template @block-developer-cookbook/preset-block-bindings

For me it runs fine with the Local app installed under Windows 11, suggesting this is system-specific rather than an issue with the Local app:

oke and again problems

npx check-node-version --print
C:\Users\rwobb\AppData\Local\npm-cache\_npx\8959868eaaadb8e0\node_modules\check-node-version\cli.js:58
    throw err;
    ^

Error: Command failed: "yarn --version"

stderr:
This project is configured to use pnpm because C:\Users\rwobb\package.json has a "packageManager" field


original error message:
Command failed: yarn --version
This project is configured to use pnpm because C:\Users\rwobb\package.json has a "packageManager" field

Does this still fail with a version issue?

npx @wordpress/create-block@latest preset-block-bindings --template @block-developer-cookbook/preset-block-bindings

If so, I recommend filing an issue in the create-block parent repo. This looks like an issue specific to that package’s approach to Node.js version checking rather than with Local.

I made that work and see this :

C:\Users\rwobb\Local Sites\learningplugins\app\public>npx check-node-version --print
node: 22.14.0
yarn: 1.22.21
pnpm: 10.7.0
npm: 8.19.4
npx: 8.19.4

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)

so there is somewhere a version 8.19 installed

im going crazy

C:\Users\rwobb\Local Sites\learningplugins\app\public>npx check-node-version --print
node: 22.14.0
yarn: 1.22.21
pnpm: 10.7.0
npx: 8.19.4
npm: 8.19.4

C:\Users\rwobb\Local Sites\learningplugins\app\public>npm --version
10.2.3

still a difference between the two versions numbers

looks to me that the windows node installer messes things up

What ever I try I see a different version with npx and npm --version and no idea why ?

Found it and solved it with

C:\Users\rwobb\Local Sites\learningplugins\app\public>npm install npm@11.2.0

So not to use -g so no global install

1 Like

Glad to hear that, @rwobben, thanks for letting us know.