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

node-gyp configure and node-gyp install fail with Node < v10.12.0 #2152

Closed
DeeDeeG opened this issue Jun 7, 2020 · 1 comment
Closed

node-gyp configure and node-gyp install fail with Node < v10.12.0 #2152

DeeDeeG opened this issue Jun 7, 2020 · 1 comment

Comments

@DeeDeeG
Copy link
Contributor

DeeDeeG commented Jun 7, 2020

  • Node Version: Node >= v6.0.0, < Node v10.12
  • Platform: Any
  • Compiler: Any
  • Module: Any
Verbose output (from npm or node-gyp):
$ npx node-gyp@7 configure
npx: installed 99 in 4.99s
gyp info it worked if it ends with ok
gyp info using node-gyp@7.0.0
gyp info using node@8.17.0 | linux | x64
gyp info find Python using Python version 3.8.2 found at "/usr/bin/python3"
gyp ERR! configure error 
gyp ERR! stack Error: EEXIST: file already exists, mkdir '/home/[user]/nodegypreq/native-module/build'
gyp ERR! System Linux 5.4.0-33-generic
gyp ERR! command "/home/[user]/n-prefix/bin/node" "/home/[user]/.npm/_npx/217155/bin/node-gyp" "configure"
gyp ERR! cwd /home/[user]/nodegypreq/native-module
gyp ERR! node -v v8.17.0
gyp ERR! node-gyp -v v7.0.0
gyp ERR! not ok 
$ npx node-gyp@7 install
gyp info it worked if it ends with ok
gyp info using node-gyp@7.0.0
gyp info using node@8.17.0 | linux | x64
gyp WARN install got an error, rolling back install
gyp ERR! install error 
gyp ERR! stack Error: EEXIST: file already exists, mkdir '/home/[user]/.cache/node-gyp/8.17.0'
gyp ERR! System Linux 5.4.0-33-generic
gyp ERR! command "/home/[user]/n-prefix/bin/node" "/home/[user]/.npm/_npx/216921/bin/node-gyp" "install"
gyp ERR! cwd /home/[user]/nodegypreq/native-module
gyp ERR! node -v v8.17.0
gyp ERR! node-gyp -v v7.0.0
gyp ERR! not ok 

When using an unsupported version of Node (< 10.12.0), there is an EEXIST: file already exists error every time beyond the first time running node-gyp configure, and every other time running node-gyp install.

This is because #2123 switched from the mkdirp module to native Node API's fs.mkdir with option {recursive: true}.

This feature (native recursive mkdir) is only available in Node v10.12.0 and up.

node-gyp already warns upon install that it is only compatible with Node >= 6.0.0. I think it should now warn about being compatible with Node >= 10.12.0 instead.


How to confirm this is the exact Node version where fs.mkdir can be recursive:

@DeeDeeG
Copy link
Contributor Author

DeeDeeG commented Jun 7, 2020

DeeDeeG@d8bbfdf

This is the fix I'm suggesting. I can submit this as a PR if interested.

@DeeDeeG DeeDeeG changed the title Consider updating "engines" to "node" : ">= 10.12.0"` in "package.json" (follow-up to #2123) node-gyp configure and node-gyp install fail with Node < v10.12.0 Jun 7, 2020
@rvagg rvagg closed this as completed Jun 16, 2020
@DeeDeeG DeeDeeG mentioned this issue Jun 21, 2021
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants