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: Add Node and npm version check #20142

Closed
gziolo opened this issue Feb 10, 2020 · 0 comments · Fixed by #20398
Closed

Create block: Add Node and npm version check #20142

gziolo opened this issue Feb 10, 2020 · 0 comments · Fixed by #20398
Assignees
Labels
[Status] In Progress Tracking issues with work in progress [Tool] Create Block /packages/create-block [Type] Bug An existing feature does not function as intended

Comments

@gziolo
Copy link
Member

gziolo commented Feb 10, 2020

Related comment #19773 (comment):

/home/build/.npm/_npx/13386/lib/node_modules/@wordpress/create-block/lib/scaffold.js:6
const { readFile, writeFile } = require( 'fs' ).promises;
        ^

TypeError: Cannot destructure property `readFile` of 'undefined' or 'null'.

with npm init @wordpress/block on node v8.14.0 (LTS),
npm 6.13.7 and WSL 1 Ubuntu (stable) (Bash on Windows).

Node 10.0.0+ is required, see:
https://github.com/WordPress/gutenberg/tree/master/packages/create-block#quick-start

(requires node version 10.0.0 or above, and npm version 6.1.0 or above)

We should add version checking in the script. Promises API for fs was added in Node 10.x.

Node 8.x is no longer maintained. See https://github.com/nodejs/Release#release-schedule.

The same applies to older versions of npm. For npm init @wordpress/block we even should increase the required version of npm to 6.9.0 because @wordpress/scripts requires it and it won't install properly for ESNext template (reported by @artpi in another place).

@gziolo gziolo added [Type] Enhancement A suggestion for improvement. [Tool] Create Block /packages/create-block labels Feb 10, 2020
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Feb 23, 2020
@gziolo gziolo added [Type] Bug An existing feature does not function as intended and removed [Type] Enhancement A suggestion for improvement. labels Feb 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] In Progress Tracking issues with work in progress [Tool] Create Block /packages/create-block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant