node.bcrypt.js icon indicating copy to clipboard operation
node.bcrypt.js copied to clipboard

Install fails when any parent directory name contains a space (Big Sur under M1)

Open ostracod opened this issue 4 years ago • 2 comments

Starting conditions:

  • macOS 11.2.3 running on M1
  • Node 14.15.4
  • NPM 6.14.10

To reproduce:

mkdir "blah blah"
cd "blah blah"
mkdir wow
cd wow
npm init -y
npm install bcrypt

Resulting error:

  CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
  LIBTOOL-STATIC Release/nothing.a
warning: /Library/Developer/CommandLineTools/usr/bin/libtool: archive library: Release/nothing.a the table of contents is empty (no object file members in the library define global symbols)
  CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
clang: error: no such file or directory: 'blah/wow/node_modules/node-addon-api'
make: *** [Release/obj.target/bcrypt_lib/src/blowfish.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/opt/homebrew/Cellar/node@14/14.15.4/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)

Counter-example (builds just fine):

mkdir blah_blah
cd blah_blah
mkdir wow
cd wow
npm init -y
npm install bcrypt

Seems like some path is not properly quoted during the build process.

ostracod avatar Apr 03 '21 17:04 ostracod

Yes I'm aware of it. It's some underlying package used by mkdirp that has this issue.

recrsn avatar Apr 03 '21 18:04 recrsn

Oh my goodness thank you so much for this. I spent several hours trying to identify a bug in node-gyp on node v16 only to find it's because there's a space in a parent directory! You're a star! 🎉

brhx avatar Sep 28 '21 16:09 brhx

Tracking it here: https://github.com/kelektiv/node.bcrypt.js/issues/961

recrsn avatar Oct 06 '22 17:10 recrsn