You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ npx node-gyp@7 configurenpx: installed 99 in 4.99sgyp info it worked if it ends with okgyp info using [email protected]gyp info using [email protected] | linux | x64gyp 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-genericgyp ERR! command "/home/[user]/n-prefix/bin/node" "/home/[user]/.npm/_npx/217155/bin/node-gyp" "configure"gyp ERR! cwd /home/[user]/nodegypreq/native-modulegyp ERR! node -v v8.17.0gyp ERR! node-gyp -v v7.0.0gyp ERR! not ok
$ npx node-gyp@7 installgyp info it worked if it ends with okgyp info using [email protected]gyp info using [email protected] | linux | x64gyp WARN install got an error, rolling back installgyp 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-genericgyp ERR! command "/home/[user]/n-prefix/bin/node" "/home/[user]/.npm/_npx/216921/bin/node-gyp" "install"gyp ERR! cwd /home/[user]/nodegypreq/native-modulegyp ERR! node -v v8.17.0gyp ERR! node-gyp -v v7.0.0gyp 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:
This is the fix I'm suggesting. I can submit this as a PR if interested.
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
Verbose output (from npm or node-gyp):
When using an unsupported version of Node (< 10.12.0), there is an
EEXIST: file already exists
error every time beyond the first time runningnode-gyp configure
, and every other time runningnode-gyp install
.This is because #2123 switched from the
mkdirp
module to native Node API'sfs.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:If you go to here: https://nodejs.org/api/fs.html#fs_fs_mkdir_path_options_callback
fs.mkdir
is added in Node v10.12.0.Also listed here: https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V10.md#10.12.0
The text was updated successfully, but these errors were encountered: