Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Block: Continue even when Node not detected correctly #40403

Closed
nextgenthemes opened this issue Apr 17, 2022 · 4 comments · Fixed by #42151
Closed

Create Block: Continue even when Node not detected correctly #40403

nextgenthemes opened this issue Apr 17, 2022 · 4 comments · Fixed by #42151
Assignees
Labels
Good First Issue An issue that's suitable for someone looking to contribute for the first time [Tool] Create Block /packages/create-block [Type] Enhancement A suggestion for improvement.

Comments

@nextgenthemes
Copy link

nextgenthemes commented Apr 17, 2022

Description

Ubuntu 21.10
Snap verson of Node. Tried 12, 14, 16, 17 same issue with all of them. Detection fails And it claims I do not have it correct version installed.

This may be an issue with the snap version of node and/or the library you are using for the detection. It worked perfectly fine, until now. A simple switch to just skip the version detection would be a good workarround I think.

node -v
v16.14.0

npx @wordpress/create-block                                                                    
Minimum system requirements not met!

Error: Wanted node version >=12 (>=12.0.0)
/home/name/.npm/_npx/0890e296436e9575/node_modules/@wordpress/create-block/lib/check-system-requirements.js:26
					check.PROGRAMS[ name ].getInstallInstructions( wanted.raw )
					              ^

TypeError: Cannot read properties of undefined (reading 'node')
    at /home/name/.npm/_npx/0890e296436e9575/node_modules/@wordpress/create-block/lib/check-system-requirements.js:26:20
    at /home/name/.npm/_npx/0890e296436e9575/node_modules/lodash/lodash.js:4967:15
    at baseForOwn (/home/name/.npm/_npx/0890e296436e9575/node_modules/lodash/lodash.js:3032:24)
    at /home/name/.npm/_npx/0890e296436e9575/node_modules/lodash/lodash.js:4936:18
    at forEach (/home/name/.npm/_npx/0890e296436e9575/node_modules/lodash/lodash.js:9410:14)
    at checkSystemRequirements (/home/name/.npm/_npx/0890e296436e9575/node_modules/@wordpress/create-block/lib/check-system-requirements.js:20:3)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Command.<anonymous> (/home/name/.npm/_npx/0890e296436e9575/node_modules/@wordpress/create-block/lib/index.js:73:4)

Step-by-step reproduction instructions

  1. sudo snap refresh node --classic --channel=16/stable
  2. npx @wordpress/create-block

Screenshots, screen recording, code snippet

No response

Environment info

Ubuntu 21.10
Snap verson of Node. Tried 12, 14, 16, 17 same issue with all of them. Detection fails And it claims I do not have it correct version installed.

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes, No

@ndiego ndiego added Needs Testing Needs further testing to be confirmed. Needs Technical Feedback Needs testing from a developer perspective. labels Apr 18, 2022
@skorasaurus skorasaurus added the [Tool] Create Block /packages/create-block label Apr 18, 2022
@gziolo
Copy link
Member

gziolo commented Apr 27, 2022

"check-node-version": "^4.1.0",

There is a newer version of https://www.npmjs.com/package/check-node-version v4.2.1, maybe that would help?

@gziolo
Copy link
Member

gziolo commented Apr 27, 2022

I see now that it’s an issue with snap according to nodejs/snap#31 (comment). It doesn’t look like it can get fixed.

We could add a prompt asking if you want to proceed anyway with a message that it didn’t detect the correct version of Node.js.

@gziolo gziolo added [Type] Enhancement A suggestion for improvement. and removed Needs Testing Needs further testing to be confirmed. Needs Technical Feedback Needs testing from a developer perspective. labels Apr 27, 2022
@gziolo gziolo changed the title create-block Node not detected corrently Create Block: Continue even when Node not detected correctly Apr 27, 2022
@gziolo gziolo added Needs Dev Ready for, and needs developer efforts Good First Issue An issue that's suitable for someone looking to contribute for the first time labels Apr 27, 2022
@t-hamano
Copy link
Contributor

t-hamano commented Jul 4, 2022

I've never used snap, but I can reproduce this error by intentionally specifying a lower node version using the node management tool.
About adding a prompt to proceed or confirm anyway when the node version is low or not detected correctly, I would like to try because I think it doesn't require a major code change 👍

@gziolo
Copy link
Member

gziolo commented Jul 4, 2022

About adding a prompt to proceed or confirm anyway when the node version is low or not detected correctly, I would like to try because I think it doesn't require a major code change 👍

@t-hamano, that would be great if you give it a try 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue An issue that's suitable for someone looking to contribute for the first time [Tool] Create Block /packages/create-block [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants