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

Pre-built binaries not installable for ... and node@8.11.1 (node-v57 ABI, unknown) (falling back to source compile with node-gyp) #364

Closed
jracle opened this issue Apr 6, 2018 · 17 comments · Fixed by #371

Comments

@jracle
Copy link

jracle commented Apr 6, 2018

Hi guys,

since yesterday I cannot retrieve my pre-built binaries (posted on amazon S3) using "latest" node-pre-gyp.

I suspect a regression in node-pre-gyp..

Here is what I get:

Pre-built binaries not installable for xxxxx and node@8.11.1 (node-v57 ABI, unknown) (falling back to source compile with node-gyp)

Thanks to investigate asap, this is a blocking issue.

@allenluce
Copy link
Contributor

Do you have full output from the install, especially any ERR! lines?

@jracle
Copy link
Author

jracle commented Apr 6, 2018

Hi @allenluce, here are the 2 error lines:

node-pre-gyp ERR! Pre-built binaries not installable for xxxx@1.0.0 and node@8.9.3 (node-v57 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Hit error ENOTDIR: Cannot cd into 'C:\Users\jracle\Dev\tmp\xxxx\build\Release'

@recrsn
Copy link

recrsn commented Apr 10, 2018

I am having a similar issue with bcrypt.

> bcrypt@2.0.0 install /tmp/node/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Pre-built binaries not installable for bcrypt@2.0.0 and node@9.11.1 (node-v59 ABI, glibc) (falling back to source compile with node-gyp) 
node-pre-gyp ERR! Hit error EEXIST: file already exists, mkdir '/tmp/node/node_modules/bcrypt/lib/binding' 
make: Entering directory '/tmp/node/node_modules/bcrypt/build'
  CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
../src/bcrypt.cc: In function ‘void encode_salt(char*, u_int8_t*, char, u_int16_t, u_int8_t)’:
../src/bcrypt.cc:114:1: warning: ‘__builtin___snprintf_chk’ output may be truncated before the last format character [-Wformat-truncation=]
 encode_salt(char *salt, u_int8_t *csalt, char minor, u_int16_t clen, u_int8_t logr)
 ^~~~~~~~~~~
In file included from /usr/include/stdio.h:862:0,
                 from ../src/bcrypt.cc:34:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:65:44: note: ‘__builtin___snprintf_chk’ output between 4 and 5 bytes into a destination of size 4
        __bos (__s), __fmt, __va_arg_pack ());
                                            ^
../src/bcrypt.cc: In function ‘void bcrypt(const char*, const char*, char*)’:
../src/bcrypt.cc:147:1: warning: ‘__builtin___snprintf_chk’ output may be truncated before the last format character [-Wformat-truncation=]
 bcrypt(const char *key, const char *salt, char *encrypted)
 ^~~~~~
In file included from /usr/include/stdio.h:862:0,
                 from ../src/bcrypt.cc:34:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:65:44: note: ‘__builtin___snprintf_chk’ output between 4 and 5 bytes into a destination of size 4
        __bos (__s), __fmt, __va_arg_pack ());
                                            ^
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
  SOLINK_MODULE(target) Release/obj.target/bcrypt_lib.node
  COPY Release/bcrypt_lib.node
  COPY /tmp/node/node_modules/bcrypt/lib/binding/bcrypt_lib.node
mkdir: cannot create directory ‘/tmp/node/node_modules/bcrypt/lib/binding/’: File exists
action_after_build.target.mk:8: recipe for target '/tmp/node/node_modules/bcrypt/lib/binding/bcrypt_lib.node' failed
make: *** [/tmp/node/node_modules/bcrypt/lib/binding/bcrypt_lib.node] Error 1
make: Leaving directory '/tmp/node/node_modules/bcrypt/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:180:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
gyp ERR! System Linux 4.13.0-38-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/tmp/node/node_modules/bcrypt/lib/binding/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/tmp/node/node_modules/bcrypt/lib/binding"
gyp ERR! cwd /tmp/node/node_modules/bcrypt
gyp ERR! node -v v9.11.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/tmp/node/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/tmp/node/node_modules/bcrypt/lib/binding' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/tmp/node/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:180:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:936:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
node-pre-gyp ERR! System Linux 4.13.0-38-generic
node-pre-gyp ERR! command "/usr/bin/node" "/tmp/node/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /tmp/node/node_modules/bcrypt
node-pre-gyp ERR! node -v v9.11.1
node-pre-gyp ERR! node-pre-gyp -v v0.7.0
node-pre-gyp ERR! not ok 
Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/tmp/node/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/tmp/node/node_modules/bcrypt/lib/binding' (1)
npm WARN node@1.0.0 No description
npm WARN node@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bcrypt@2.0.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the bcrypt@2.0.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/amitosh/.npm/_logs/2018-04-10T18_17_52_456Z-debug.log

It seems that the folder is not being created, rather a file with contents any random file from the download tarball is being added.

Here's our node-pre-gyp config inside package.json

"binary": {
    "module_name": "bcrypt_lib",
    "module_path": "./lib/binding/",
    "host": "https://github.com",
    "remote_path": "/kelektiv/node.bcrypt.js/releases/download/v{version}/",
    "package_name": "{module_name}-v{version}-{node_abi}-{platform}-{arch}-{libc}.tar.gz"
  }

@allenluce
Copy link
Contributor

bcrypt was running into #359 I think @jracle is running into another problem.

My module specifies ./lib as the module_path. The path.dirname() call in package.js lops the lib off that path. The resulting tar file has everything in the repo in it. This screws up the installs.

I'm not sure why that line is in there, it showed up as part of #299 which was merged on Mar 9. Seems that 0.7.1 through 0.9.1 are affected by this. I'm not the only one to get hit by it, grpc/grpc-node#232 downgraded to 0.7.0 to avoid this problem.

@springmeyer Have any idea why that path.dirname() is in there? Can it be removed?

@jracle
Copy link
Author

jracle commented Apr 26, 2018

Thanks @allenluce , I still get the issue (on Windows). I'm full-speed on a project which is using node-pre-gyp), but cannot dig into your code now unfortunately! The issue is not critical, cause I'm doing an electron-rebuild anyways, but will become critical for my users who need the nodejs client not to be recompiled.

Thanks guys for looking at it!

Best,
Julien

@allenluce
Copy link
Contributor

No worries @jracle. If it becomes critical before a fix is applied, a downgrade to 0.7.0 might take care of it for you.

@springmeyer
Copy link
Contributor

@springmeyer Have any idea why that path.dirname() is in there? Can it be removed?

@allenluce I don't, as it was added by @isaacs. But I'm in agreement that it may be the problem behind this and #356 (comment)

@allenluce would you mind putting up a PR removing that line to:

  • see what breaks on travis?
  • if nothing breaks, we'll merge and release?

I'm very limited on dev time right now, so would welcome the help.

@allenluce
Copy link
Contributor

@springmeyer No problem. It ended up being a little more involved than just removing that line.

allenluce pushed a commit to allenluce/mmap-object that referenced this issue Apr 26, 2018
Node-pre-gyp 0.7.1 through 0.9.1 have problems as detailed in
mapbox/node-pre-gyp#364. The downgrade
should avoid those. Once the fix is merged the version can be updated.

There were problems compiling on macOS related to
https://stackoverflow.com/questions/21752172/invalid-deployment-target-for-stdlib-libc-on-osx-10-8.
This sets the deployment target to 10.9 which may preclude older macOS
versions from using this module.
@springmeyer
Copy link
Contributor

Huge thanks for diving in to fix @allenluce. Will take a look over at #371

@recrsn
Copy link

recrsn commented Apr 27, 2018

@allenluce Along with #359, we were running into this issue (node giving an ENOTDIR, and our lib directory containing all our files), we caught it in CI and stalled a release for this. We fixed it by moving the native module into another directory. The compiled module now only stays in lib/binding.

AlCalzone added a commit to AlCalzone/node-aead-crypto that referenced this issue Apr 30, 2018
Apparently 0.7.1..0.9.1 have another installation issue:
mapbox/node-pre-gyp#364
@mapsam
Copy link
Member

mapsam commented May 1, 2018

Thanks for the fix @allenluce! This just shipped in version 0.10.0

@allenluce
Copy link
Contributor

Sounds good, thanks for the merge! As Windows is pretty painful for me to dev on, I'm hoping @AlCalzone's issue had to do with building with a different version than was in his package.json.

@yogbharat1
Copy link

I have similar issue with installing firebase with Angular 7

grpc@1.17.0 install C:\Users\yogeshin\Documents\Tutorials\Angular\firebaseauth\node_modules\grpc
node-pre-gyp install --fallback-to-build --library=static_library

node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp WARN Pre-built binaries not installable for grpc@1.17.0 and node@8.12.0 (node-v57 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error unable to get local issuer certificate
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:\Users\yogeshin\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack at PythonFinder. (C:\Users\yogeshin\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack at C:\Users\yogeshin\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:282:31
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\yogeshin\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "--module=C:\Users\yogeshin\Documents\Tutorials\Angular\firebaseauth\node_modules\grpc\src\node\extension_binary\node-v57-win32-x64-unknown\grpc_node.node" "--module_name=grpc_node" "--module_path=C:\Users\yogeshin\Documents\Tutorials\Angular\firebaseauth\node_modules\grpc\src\node\extension_binary\node-v57-win32-x64-unknown" "--napi_version=3" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v57"
gyp ERR! cwd C:\Users\yogeshin\Documents\Tutorials\Angular\firebaseauth\node_modules\grpc
gyp ERR! node -v v8.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\yogeshin\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --library=static_library --module=C:\Users\yogeshin\Documents\Tutorials\Angular\firebaseauth\node_modules\grpc\src\node\extension_binary\node-v57-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=C:\Users\yogeshin\Documents\Tutorials\Angular\firebaseauth\node_modules\grpc\src\node\extension_binary\node-v57-win32-x64-unknown --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v57' (1)
node-pre-gyp ERR! stack at ChildProcess. (C:\Users\yogeshin\Documents\Tutorials\Angular\firebaseauth\node_modules\grpc\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:126:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:214:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:915:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
node-pre-gyp ERR! System Windows_NT 10.0.16299
node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\yogeshin\Documents\Tutorials\Angular\firebaseauth\node_modules\grpc\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd C:\Users\yogeshin\Documents\Tutorials\Angular\firebaseauth\node_modules\grpc
node-pre-gyp ERR! node -v v8.12.0
node-pre-gyp ERR! node-pre-gyp -v v0.12.0
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\yogeshin\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --library=static_library --module=C:\Users\yogeshin\Documents\Tutorials\Angular\firebaseauth\node_modules\grpc\src\node\extension_binary\node-v57-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=C:\Users\yogeshin\Documents\Tutorials\Angular\firebaseauth\node_modules\grpc\src\node\extension_binary\node-v57-win32-x64-unknown --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v57' (1)
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\yogeshin\Documents\Tutorials\Angular\firebaseauth\package.json'
npm WARN @angular/fire@5.1.1 requires a peer of @angular/common@>=6.0.0 <8 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/fire@5.1.1 requires a peer of @angular/core@>=6.0.0 <8 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/fire@5.1.1 requires a peer of @angular/platform-browser@>=6.0.0 <8 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/fire@5.1.1 requires a peer of @angular/platform-browser-dynamic@>=6.0.0 <8 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/fire@5.1.1 requires a peer of rxjs@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/fire@5.1.1 requires a peer of zone.js@^0.8.0 but none is installed. You must install peer dependencies yourself.
npm WARN firebaseauth No description
npm WARN firebaseauth No repository field.
npm WARN firebaseauth No README data
npm WARN firebaseauth No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc@1.17.0 install: node-pre-gyp install --fallback-to-build --library=static_library
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the grpc@1.17.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\yogeshin\AppData\Roaming\npm-cache_logs\2019-01-18T06_15_16_494Z-debug.log

@recrsn
Copy link

recrsn commented Jan 18, 2019

@yogbharat1 Install python2 and the entire suite of windows-build-tools (it's huge). Else, try updating grpc, which will probably be having the prebuilt version.

@mrdulin
Copy link

mrdulin commented Jan 22, 2019

same issue when build a docker image:

> bcrypt@3.0.0 install /app/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Pre-built binaries not installable for bcrypt@3.0.0 and node@8.11.4 (node-v57 ABI, musl) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error socket hang up
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:406:16)
gyp ERR! stack     at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:68:16)
gyp ERR! stack     at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Linux 4.9.125-linuxkit
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/app/node_modules/bcrypt/lib/binding/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/app/node_modules/bcrypt/lib/binding" "--napi_version=3" "--node_abi_napi=napi"
gyp ERR! cwd /app/node_modules/bcrypt
gyp ERR! node -v v8.11.4
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/app/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/app/node_modules/bcrypt/lib/binding --napi_version=3 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/app/node_modules/bcrypt/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:126:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:925:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
node-pre-gyp ERR! System Linux 4.9.125-linuxkit
node-pre-gyp ERR! command "/usr/local/bin/node" "/app/node_modules/bcrypt/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /app/node_modules/bcrypt
node-pre-gyp ERR! node -v v8.11.4
node-pre-gyp ERR! node-pre-gyp -v v0.10.2
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/app/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/app/node_modules/bcrypt/lib/binding --napi_version=3 --node_abi_napi=napi' (1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bcrypt@3.0.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt@3.0.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-01-22T09_39_00_762Z-debug.log

@allenluce
Copy link
Contributor

I'm not able to repro the errors seen by @yogbharat1 or @mrdulin. What OS are each of you using? Can you re-run the installation with -dd to get more output? My guess is that your problems are unrelated to the problem I ran into originally which was fixed by the #371.

@mrdulin
Copy link

mrdulin commented Jan 23, 2019

@allenluce Thanks for reply.

Here is my Dockerfile:

FROM mhart/alpine-node:8.11.4
ENV PORT 3200

WORKDIR /app
COPY ./package.json ./package-lock.json /app/
COPY ./ /app/

RUN apk update \
  && apk add curl python --no-cache --virtual build-dependencies build-base gcc \
  && npm i -g npm@latest \
  && npm i

HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
  CMD curl -f http://localhost:$PORT/version || exit 1

EXPOSE ${PORT}
CMD [ "npm", "start" ]

I solved this issue by adding below command:

apk add curl python --no-cache --virtual build-dependencies build-base gcc 

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.

7 participants