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

Add "engines" to the package.json and "engine-strict = true" to the .… #23600

Conversation

ixkaito
Copy link
Contributor

@ixkaito ixkaito commented Jul 1, 2020

Add engines to the package.json and engine-strict = true to the .npmrc

Description

Use npm native configuration to specify the version of node. This would display warnings before npm install starting if we were using wrong version of node. When we got errors after npm install or npm run build: 🙁. Let's save time 🙂.

How has this been tested?

$ node -v
v14.3.0
$ npm i  
npm ERR! code ENOTSUP
npm ERR! notsup Unsupported engine for gutenberg@8.4.0: wanted: {"node":"12.x"} (current: {"node":"14.3.0","npm":"6.14.5"})
npm ERR! notsup Not compatible with your version of node/npm: gutenberg@8.4.0
npm ERR! notsup Not compatible with your version of node/npm: gutenberg@8.4.0
npm ERR! notsup Required: {"node":"12.x"}
npm ERR! notsup Actual:   {"npm":"6.14.5","node":"14.3.0"}

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/kite/.npm/_logs/2020-07-01T00_23_22_447Z-debug.log
$ node -v
v12.6.1
$ npm i
up to date in 22.5s

167 packages are looking for funding
  run `npm fund` for details

Screenshots

Types of changes

New feature (non-breaking change which adds functionality)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR.

@gziolo gziolo added the [Type] Build Tooling Issues or PRs related to build tooling label Jul 1, 2020
@gziolo
Copy link
Member

gziolo commented Jul 1, 2020

Any particular reason why Node 13 and 14 shouldn’t be allowed?

@ixkaito
Copy link
Contributor Author

ixkaito commented Jul 2, 2020

I failed npm i && npm run build on Node 14.3.0. If Gutenberg is tested on Node 13 and 14, it could be { "engines" : { "node" : ">=12.x" } }

@gziolo
Copy link
Member

gziolo commented Jul 2, 2020

Ideally, it works on Node.js 12, 13 and 14. Do you know why it errors on 14.x? In the past, the main reason was that one of the dependencies wasn’t using the latest version possible that is compatible with the most recent version of Node.js.

By the way, I wasn’t aware that you can enforce an error when using engines. Does it mean that we wouldn’t need to run npm run check-engines anymore?

@ixkaito
Copy link
Contributor Author

ixkaito commented Jul 2, 2020

It failed at the nodegit on Node 13.14.0, 14.3.0 and 14.5.0. Npm packages often bring problems on latest Node. Maybe it's better to specify the LTS version or use a range like ">=12.x <=12.x".

Does it mean that we wouldn’t need to run npm run check-engines anymore?

Yes, I think we wouldn't need the check-engines script anymore. However, this only warns before npm install. If people changed their Node versions after npm install, it wouldn't give any messages before npm run.

I pushed a new commit adding "npm": ">=6.9.0" to engines according to the check-enginesscript.

Here's the error message of Node 14.5.0 (similar to 13.14.0 and 14.3.0):

$ node -v            
v14.5.0

$ npm i  

> appium-windows-driver@1.8.0 install /Users/kite/WordPress/gutenberg/node_modules/appium/node_modules/appium-windows-driver
> node install-npm.js

Not installing WinAppDriver since did not detect a Windows system

> fsevents@1.2.9 install /Users/kite/WordPress/gutenberg/node_modules/fsevents
> node install

node-pre-gyp WARN Using request for node-pre-gyp https download 
node-pre-gyp WARN Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.2.9/fse-v1.2.9-node-v83-darwin-x64.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for fsevents@1.2.9 and node@14.5.0 (node-v83 ABI, unknown) (falling back to source compile with node-gyp) 
  SOLINK_MODULE(target) Release/.node
  CXX(target) Release/obj.target/fse/fsevents.o
In file included from ../fsevents.cc:6:
In file included from ../../nan/nan.h:2884:
../../nan/nan_typedarray_contents.h:34:43: warning: 'GetContents' is deprecated: Use GetBackingStore. See http://crbug.com/v8/9908. [-Wdeprecated-declarations]
      data   = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
                                          ^
/Users/kite/Library/Caches/node-gyp/14.5.0/include/node/v8.h:5254:3: note: 'GetContents' has been explicitly marked deprecated here
  V8_DEPRECATE_SOON("Use GetBackingStore. See http://crbug.com/v8/9908.")
  ^
/Users/kite/Library/Caches/node-gyp/14.5.0/include/node/v8config.h:402:39: note: expanded from macro 'V8_DEPRECATE_SOON'
# define V8_DEPRECATE_SOON(message) [[deprecated(message)]]
                                      ^
1 warning generated.
  SOLINK_MODULE(target) Release/fse.node
  COPY /Users/kite/WordPress/gutenberg/node_modules/fsevents/lib/binding/Release/node-v83-darwin-x64/fse.node
  TOUCH Release/obj.target/action_after_build.stamp

> nodegit@0.26.2 install /Users/kite/WordPress/gutenberg/node_modules/nodegit
> node lifecycleScripts/preinstall && node lifecycleScripts/install

[nodegit] Running pre-install script
[nodegit] Running install script
node-pre-gyp
WARN Using request for node-pre-gyp https download
node-pre-gyp
WARN Tried to download(404): https://axonodegit.s3.amazonaws.com/nodegit/nodegit/nodegit-v0.26.2-node-v83-darwin-x64.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for nodegit@0.26.2 and node@14.5.0 (node-v83 ABI, unknown) (falling back to source compile with node-gyp)
SOLINK_MODULE(target) Release/acquireOpenSSL.node
ACTION binding_gyp_configureLibssh2_target_configure .
[nodegit] Configuring libssh2.
SOLINK_MODULE(target) Release/configureLibssh2.node
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/allocators/stdalloc.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/commit.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/alloc.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/annotated_commit.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/apply.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/attr_file.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/attr.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/attrcache.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/blame_git.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/blame.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/blob.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/branch.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/buf_text.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/buffer.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/cache.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/checkout.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/cherrypick.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/clone.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/commit_list.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/config_cache.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/config_entries.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/config_file.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/config_mem.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/config_parse.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/config_snapshot.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/config.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/crlf.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/date.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/delta.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/diff_driver.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/diff_file.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/diff_generate.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/diff_parse.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/diff_print.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/diff_stats.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/diff_tform.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/diff_xdiff.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/diff.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/errors.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/fetch.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/fetchhead.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/filebuf.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/futils.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/filter.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/global.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/graph.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/hash.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/hash/sha1/sha1dc/sha1.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/hash/sha1/sha1dc/ubc_check.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/hash/sha1/collisiondetect.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/hashsig.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/ident.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/idxmap.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/ignore.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/index.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/indexer.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/iterator.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/mailmap.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/merge_driver.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/merge_file.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/merge.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/message.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/mwindow.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/net.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/netops.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/notes.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/object_api.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/object.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/odb_loose.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/odb_mempack.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/odb_pack.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/odb.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/offmap.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/oid.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/oidarray.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/oidmap.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/streams/mbedtls.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/streams/openssl.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/streams/registry.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/pack-objects.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/pack.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/parse.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/patch_generate.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/patch_parse.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/patch.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/path.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/pathspec.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/pool.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/posix.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/pqueue.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/proxy.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/push.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/reader.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/rebase.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/refdb_fs.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/refdb.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/reflog.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/refs.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/refspec.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/remote.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/repository.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/reset.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/revert.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/revparse.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/revwalk.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/settings.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/sha1_lookup.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/signature.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/streams/socket.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/sortedcache.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/stash.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/status.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/strmap.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/submodule.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/sysdir.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/tag.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/thread-utils.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/trace.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/trailer.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/transaction.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/transport.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/transports/cred_helpers.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/transports/cred.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/transports/git.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/transports/local.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/transports/smart_pkt.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/transports/smart_protocol.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/transports/smart.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/transports/ssh.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/tree-cache.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/tree.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/tsort.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/util.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/varint.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/vector.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/wildmatch.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/worktree.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/xdiff/xdiffi.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/xdiff/xemit.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/xdiff/xhistogram.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/xdiff/xmerge.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/xdiff/xpatience.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/xdiff/xprepare.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/xdiff/xutils.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/zstream.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/streams/stransport.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/transports/http.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/transports/auth.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/transports/auth_negotiate.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/transports/auth_ntlm.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/streams/tls.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/unix/map.o
CC(target) Release/obj.target/libgit2/vendor/libgit2/src/unix/realpath.o
LIBTOOL-STATIC Release/git2.a
libtool: unrecognized option `-static'
libtool: Try `libtool --help' for more information.
make: *** [Release/git2.a] Error 1
gyp
ERR!
build error
gyp ERR! stack
Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/kite/.anyenv/envs/nodenv/versions/14.5.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
gyp ERR!
stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System
Darwin 19.5.0
gyp ERR! command "/Users/kite/.anyenv/envs/nodenv/versions/14.5.0/bin/node" "/Users/kite/.anyenv/envs/nodenv/versions/14.5.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/kite/WordPress/gutenberg/node_modules/nodegit/build/Release/nodegit.node" "--module_name=nodegit" "--module_path=/Users/kite/WordPress/gutenberg/node_modules/nodegit/build/Release" "--napi_version=6" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83"
gyp
ERR! cwd /Users/kite/WordPress/gutenberg/node_modules/nodegit
gyp ERR! node -v v14.5.0
gyp ERR!
node-gyp -v v5.1.0
gyp ERR! not ok
node-pre-gyp
ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/Users/kite/.anyenv/envs/nodenv/versions/14.5.0/bin/node /Users/kite/.anyenv/envs/nodenv/versions/14.5.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/kite/WordPress/gutenberg/node_modules/nodegit/build/Release/nodegit.node --module_name=nodegit --module_path=/Users/kite/WordPress/gutenberg/node_modules/nodegit/build/Release --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
node-pre-gyp ERR!
stack     at ChildProcess.<anonymous> (/Users/kite/WordPress/gutenberg/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1051:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
node-pre-gyp ERR! System Darwin 19.5.0
node-pre-gyp ERR!
command "/Users/kite/.anyenv/envs/nodenv/versions/14.5.0/bin/node" "/Users/kite/WordPress/gutenberg/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/kite/WordPress/gutenberg/node_modules/nodegit
node-pre-gyp ERR! node -v v14.5.0
node-pre-gyp ERR! node-pre-gyp -v
v0.13.0
node-pre-gyp ERR! not ok
Failed to execute '/Users/kite/.anyenv/envs/nodenv/versions/14.5.0/bin/node /Users/kite/.anyenv/envs/nodenv/versions/14.5.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/kite/WordPress/gutenberg/node_modules/nodegit/build/Release/nodegit.node --module_name=nodegit --module_path=/Users/kite/WordPress/gutenberg/node_modules/nodegit/build/Release --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
[nodegit] ERROR - Could not finish install
[nodegit] ERROR - finished with error code: 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nodegit@0.26.2 install: `node lifecycleScripts/preinstall && node lifecycleScripts/install`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the nodegit@0.26.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/kite/.npm/_logs/2020-07-02T07_30_47_835Z-debug.log

@gziolo
Copy link
Member

gziolo commented Jul 4, 2020

Have you tried updating nodegit to the latest version?

If it doesn’t work we can land your PR as is and address issues with node 14 separately.

@ixkaito
Copy link
Contributor Author

ixkaito commented Jul 4, 2020

I don't have nodegit installed globally. It's a dependency of @wordpress/env.

"nodegit": "^0.26.2",

I tried to change nodegit to the latest stable 0.28.3, but npm i failed either.

@gziolo
Copy link
Member

gziolo commented Jul 6, 2020

I tried to change nodegit to the latest stable 0.28.3, but npm i failed either.

It seems like something that should be resolved in the nodegit package first. It doesn't look like they this issue tracked: https://github.com/nodegit/nodegit/issues. If they don't fix it in the upcoming weeks we should consider switching to another package.

To be clear, if the goal is to ensure that @wordpress/env can be run only with Node 12.x, it should be updated in here:

https://github.com/WordPress/gutenberg/blob/master/packages/env/package.json

@gziolo gziolo added [Tool] Env /packages/env [Type] Enhancement A suggestion for improvement. labels Jul 6, 2020
@gziolo
Copy link
Member

gziolo commented Jul 6, 2020

I tested simplegit that we use in other places and it installs immediately with node 14.5.0. For nodegit it took 2-3 minutes but it was also successful.

@ixkaito
Copy link
Contributor Author

ixkaito commented Jul 6, 2020

There was a similar issue tracked: nodegit/nodegit#1620. It seems this was a python issue.

I succeeded in npm i and npm run build on Node 10.x, 12.x and 14.x after setting the path of python correctly, and I pushed a new commit changing the node engine to >=10.0.0 according to check-engines.

@gziolo gziolo removed the [Tool] Env /packages/env label Jul 6, 2020
Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thank you for all the testing and changes applied.

@gziolo
Copy link
Member

gziolo commented Jul 6, 2020

One more thing, do you think we should remove the following script:

"prebuild": "npm run check-engines",

"check-engines": "wp-scripts check-engines",

"predev": "npm run check-engines",

They all use npm package to check engines which seems to be obsolete now.

@ixkaito
Copy link
Contributor Author

ixkaito commented Jul 6, 2020

Yes, it's a good idea to keep npm scripts simpler. I pushed a new commit to remove those obsolete scripts.

@gziolo
Copy link
Member

gziolo commented Jul 6, 2020

@ixkaito, thank you!

@gziolo gziolo merged commit 7214db2 into WordPress:master Jul 6, 2020
@github-actions github-actions bot added this to the Gutenberg 8.5 milestone Jul 6, 2020
pento pushed a commit to WordPress/wordpress-develop that referenced this pull request Sep 11, 2022
Using NPM 7+ currently causes a number of issues. In order to improve developer experience, we should prevent a developer from going down the road of using incompatible engines.

See also: WordPress/gutenberg#29204 and WordPress/gutenberg#23600.

Props rcorrales.
Fixes #56547.



git-svn-id: https://develop.svn.wordpress.org/trunk@54124 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Sep 11, 2022
Using NPM 7+ currently causes a number of issues. In order to improve developer experience, we should prevent a developer from going down the road of using incompatible engines.

See also: WordPress/gutenberg#29204 and WordPress/gutenberg#23600.

Props rcorrales.
Fixes #56547.


Built from https://develop.svn.wordpress.org/trunk@54124


git-svn-id: http://core.svn.wordpress.org/trunk@53683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
github-actions bot pushed a commit to platformsh/wordpress-performance that referenced this pull request Sep 11, 2022
Using NPM 7+ currently causes a number of issues. In order to improve developer experience, we should prevent a developer from going down the road of using incompatible engines.

See also: WordPress/gutenberg#29204 and WordPress/gutenberg#23600.

Props rcorrales.
Fixes #56547.


Built from https://develop.svn.wordpress.org/trunk@54124


git-svn-id: https://core.svn.wordpress.org/trunk@53683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
whereiscodedude pushed a commit to whereiscodedude/wpss that referenced this pull request Sep 18, 2022
Using NPM 7+ currently causes a number of issues. In order to improve developer experience, we should prevent a developer from going down the road of using incompatible engines.

See also: WordPress/gutenberg#29204 and WordPress/gutenberg#23600.

Props rcorrales.
Fixes #56547.


Built from https://develop.svn.wordpress.org/trunk@54124
ootwch pushed a commit to ootwch/wordpress-develop that referenced this pull request Nov 4, 2022
Using NPM 7+ currently causes a number of issues. In order to improve developer experience, we should prevent a developer from going down the road of using incompatible engines.

See also: WordPress/gutenberg#29204 and WordPress/gutenberg#23600.

Props rcorrales.
Fixes #56547.



git-svn-id: https://develop.svn.wordpress.org/trunk@54124 602fd350-edb4-49c9-b593-d223f7449a82
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Build Tooling Issues or PRs related to build tooling [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants