Skip to content

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

Closed
@DeeDeeG

Description

@DeeDeeG
  • 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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions