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

npm v7 fails on node v10.0 (~~and v10.1-v10.9~~) #2623

Closed
ljharb opened this issue Feb 4, 2021 · 9 comments · Fixed by npm/run-script#21 or #2654
Closed

npm v7 fails on node v10.0 (~~and v10.1-v10.9~~) #2623

ljharb opened this issue Feb 4, 2021 · 9 comments · Fixed by npm/run-script#21 or #2654
Assignees
Labels
Bug thing that needs fixing Priority 1 high priority issue Release 7.x work is associated with a specific npm 7 release

Comments

@ljharb
Copy link
Collaborator

ljharb commented Feb 4, 2021

Current Behavior:

Run npm install on node v10.0 - v10.9, it will fail: https://github.com/ljharb/publishers/pull/8/checks?check_run_id=1834032724 / https://github.com/ljharb/es-value-fixtures/pull/2/checks?check_run_id=1833723968

Expected Behavior:

npm install to complete successfully, as it does on node v10.10+ (since engines.node is >= 10)

Steps To Reproduce:

I suspect this will happen on any npm install command on these node versions

Environment:

  • Node: v10.0 - v10.9
  • npm: v7.5.2
@ljharb ljharb added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Feb 4, 2021
@darcyclarke darcyclarke added Priority 1 high priority issue and removed Needs Triage needs review for next steps labels Feb 4, 2021
@darcyclarke darcyclarke added this to the OSS - Sprint 23 milestone Feb 4, 2021
isaacs added a commit to npm/installed-package-contents that referenced this issue Feb 5, 2021
isaacs added a commit to npm/installed-package-contents that referenced this issue Feb 5, 2021
isaacs added a commit to npm/installed-package-contents that referenced this issue Feb 5, 2021
isaacs added a commit to npm/installed-package-contents that referenced this issue Feb 5, 2021
isaacs added a commit to npm/installed-package-contents that referenced this issue Feb 5, 2021
isaacs added a commit to npm/installed-package-contents that referenced this issue Feb 5, 2021
@wraithgar
Copy link
Member

This is addressed by npm/installed-package-contents#4
npm/installed-package-contents#4

@ljharb
Copy link
Collaborator Author

ljharb commented Feb 8, 2021

Which version of npm will include this fix?

@wraithgar
Copy link
Member

I believe this got pulled in with v7.5.3 #2626

@ljharb
Copy link
Collaborator Author

ljharb commented Feb 8, 2021

Hmm, v10.0 is still failing with TypeError: Cannot destructure property stat of 'undefined' or 'null'.: https://github.com/ljharb/publishers/pull/8/checks?check_run_id=1858247201 inside node_modules/@npmcli/node-gyp/lib/index.js:2:29, so i think this needs to be reopened - although npm/installed-package-contents@5f90dfa seems to have fixed v10.1-v10.9, yay!

@ljharb ljharb reopened this Feb 8, 2021
@ljharb ljharb changed the title npm v7 fails on node v10.0-v10.9 npm v7 fails on node v10.0 (~~and v10.1-v10.9~~) Feb 8, 2021
@ljharb
Copy link
Collaborator Author

ljharb commented Feb 8, 2021

Specifically, this is because node v10.0 doesn't actually have fs.promises - however, util.promisify(fs.stat) should work there. I'll try to make a PR.

@ljharb
Copy link
Collaborator Author

ljharb commented Feb 8, 2021

Filed as npm/node-gyp#5.

@ruyadorno
Copy link
Collaborator

@ljharb it looks like there are a couple more places in the cli:

$ git grep require..fs...promises
lib/utils/reify-finish.js:const {writeFile} = require('fs').promises
node_modules/@npmcli/node-gyp/lib/index.js:const {stat} = require('fs').promises
node_modules/@npmcli/run-script/lib/is-server-package.js:const { stat } = require('fs').promises

@ljharb
Copy link
Collaborator Author

ljharb commented Feb 8, 2021

woof, ok

@ljharb
Copy link
Collaborator Author

ljharb commented Feb 8, 2021

npm/run-script#21 and #2654

@ljharb ljharb reopened this Feb 10, 2021
ljharb added a commit to ljharb/cli that referenced this issue Feb 10, 2021
In this node version, fall back to `util.promisify` of the callback version.

Maybe fixes npm#2623. Maybe fixes npm#2652. Maybe fixes npm#2625.
@ljharb ljharb reopened this Feb 10, 2021
ljharb added a commit to ljharb/cli that referenced this issue Feb 10, 2021
In this node version, fall back to `util.promisify` of the callback version.

Maybe fixes npm#2623. Maybe fixes npm#2652. Maybe fixes npm#2625.
ljharb added a commit to ljharb/cli that referenced this issue Feb 10, 2021
In this node version, fall back to `util.promisify` of the callback version.

Maybe fixes npm#2623. Maybe fixes npm#2652. Maybe fixes npm#2625.
ljharb added a commit to ljharb/cli that referenced this issue Feb 10, 2021
In this node version, fall back to `util.promisify` of the callback version.

Maybe fixes npm#2623. Maybe fixes npm#2652. Maybe fixes npm#2625.
ljharb added a commit to ljharb/cli that referenced this issue Feb 10, 2021
In this node version, fall back to `util.promisify` of the callback version.

Maybe fixes npm#2623. Maybe fixes npm#2652. Maybe fixes npm#2625.
ljharb added a commit to ljharb/cli that referenced this issue Feb 11, 2021
In this node version, fall back to `util.promisify` of the callback version.

Maybe fixes npm#2623. Maybe fixes npm#2652. Maybe fixes npm#2625.
ljharb added a commit to ljharb/cli that referenced this issue Feb 11, 2021
In this node version, fall back to `util.promisify` of the callback version.

Maybe fixes npm#2623. Maybe fixes npm#2652. Maybe fixes npm#2625.
ljharb added a commit to ljharb/cli that referenced this issue Feb 11, 2021
In this node version, fall back to `util.promisify` of the callback version.

Maybe fixes npm#2623. Maybe fixes npm#2652. Maybe fixes npm#2625.
ljharb added a commit to ljharb/cli that referenced this issue Feb 11, 2021
In this node version, fall back to `util.promisify` of the callback version.

Maybe fixes npm#2623. Maybe fixes npm#2652. Maybe fixes npm#2625.
ljharb added a commit to ljharb/cli that referenced this issue Feb 11, 2021
In this node version, fall back to `util.promisify` of the callback version.

Maybe fixes npm#2623. Maybe fixes npm#2652. Maybe fixes npm#2625.
ljharb added a commit to ljharb/cli that referenced this issue Feb 11, 2021
In this node version, fall back to `util.promisify` of the callback version.

Maybe fixes npm#2623. Maybe fixes npm#2652. Maybe fixes npm#2625.
ljharb added a commit to ljharb/cli that referenced this issue Feb 11, 2021
In this node version, fall back to `util.promisify` of the callback version.

Maybe fixes npm#2623. Maybe fixes npm#2652. Maybe fixes npm#2625.
ljharb added a commit to ljharb/cli that referenced this issue Feb 11, 2021
In this node version, fall back to `util.promisify` of the callback version.

Maybe fixes npm#2623. Maybe fixes npm#2652. Maybe fixes npm#2625.
ljharb added a commit to ljharb/cli that referenced this issue Feb 11, 2021
In this node version, fall back to `util.promisify` of the callback version.

Maybe fixes npm#2623. Maybe fixes npm#2652. Maybe fixes npm#2625.
ljharb added a commit to ljharb/cli that referenced this issue Feb 11, 2021
In this node version, fall back to `util.promisify` of the callback version.

Maybe fixes npm#2623. Maybe fixes npm#2652. Maybe fixes npm#2625.
ljharb added a commit to ljharb/cli that referenced this issue Feb 11, 2021
In this node version, fall back to `util.promisify` of the callback version.

Maybe fixes npm#2623. Maybe fixes npm#2652. Maybe fixes npm#2625.
ljharb added a commit to ljharb/cli that referenced this issue Feb 11, 2021
In this node version, fall back to `util.promisify` of the callback version.

Maybe fixes npm#2623. Maybe fixes npm#2652. Maybe fixes npm#2625.
ljharb added a commit to ljharb/cli that referenced this issue Feb 11, 2021
In this node version, fall back to `util.promisify` of the callback version.

Maybe fixes npm#2623. Maybe fixes npm#2652. Maybe fixes npm#2625.
ljharb added a commit to ljharb/cli that referenced this issue Feb 11, 2021
In this node version, fall back to `util.promisify` of the callback version.

Maybe fixes npm#2623. Maybe fixes npm#2652. Maybe fixes npm#2625.
ljharb added a commit to ljharb/cli that referenced this issue Feb 12, 2021
In this node version, fall back to `util.promisify` of the callback version.

Maybe fixes npm#2623. Maybe fixes npm#2652. Maybe fixes npm#2625.
ljharb added a commit to ljharb/cli that referenced this issue Feb 12, 2021
In this node version, fall back to `util.promisify` of the callback version.

Maybe fixes npm#2623. Maybe fixes npm#2652. Maybe fixes npm#2625.
ljharb added a commit to ljharb/cli that referenced this issue Feb 12, 2021
In this node version, fall back to `util.promisify` of the callback version.

Maybe fixes npm#2623. Maybe fixes npm#2652. Maybe fixes npm#2625.
ljharb added a commit to ljharb/cli that referenced this issue Feb 12, 2021
In this node version, fall back to `util.promisify` of the callback version.

Maybe fixes npm#2623. Maybe fixes npm#2652. Maybe fixes npm#2625.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Priority 1 high priority issue Release 7.x work is associated with a specific npm 7 release
Projects
None yet
5 participants