node-argon2: 0.25.0 is broken on MacOS
Welcome to the issues section if it’s your first time!
Steps to reproduce
- Create a blank node project via
npm init -y - Add
argon2vianpm i --save argon2 - Create an index.js file that consists of just the line
var argon2 = require("argon2"); - Run
node .
Expected behaviour
argon2 should be successfully installed by npm. argon2 should be usable on MacOS
Actual behaviour
npm produces on output when installing argon2 on MacOS:
npm i --save argon2
> argon2@0.25.0 install /private/tmp/foo/node_modules/argon2
> node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using needle for node-pre-gyp https download
[argon2] Success: "/private/tmp/foo/node_modules/argon2/lib/binding/argon2.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
argon2 cannot be loaded by Node on MacOS:
internal/modules/cjs/loader.js:977
return process.dlopen(module, path.toNamespacedPath(filename));
^
Error: dlopen(/private/tmp/foo/node_modules/argon2/lib/binding/argon2.node, 1): no suitable image found. Did find:
/private/tmp/foo/node_modules/argon2/lib/binding/argon2.node: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00
/private/tmp/foo/node_modules/argon2/lib/binding/argon2.node: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00
Environment
Operating system: MacOS Mojave 10.14.6
Node version: v12.9.1
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 22
- Comments: 35 (13 by maintainers)
Confirmed – same issue here using node or npm
Yep @pe8ter, 0.24.1 still works.
If anyone newer to package versioning comes along, you can install the rollback version with one of the following commands 😃
npm install argon2@0.24.1oryarn add argon2@0.24.1@ranisalt - anything any of us can do to help or good for now?
@ranisalt I confirmed
0.25.1works on macOS.I just tried this:
This causes npm to build the package from source:
Everything works correctly this way.
It appears that when it’s installed via npm, it chooses the wrong prebuilt binaries.
hmm, odd. Might be a cache/package lock issue. Go nuclear!
Does that work? I was able to install in a new directory.
package.json should have
Somewhere inside of it. So I’m going to guess package-lock issue (hope so at least!)
@jaschaio Do you have GCC installed? https://github.com/ranisalt/node-argon2#before-installing
@ranisalt Did you
git pushwith--tags? If so, probably a bug.Until we can do the TravisCI upload or #208 is merged, we need to temporary let the user rebuild from source.
If you have time, please deprecate v0.25.0 and publish v0.25.1 without the
/libfolder. (not related, but it’s better to use files instead of.gitignoreimo)Sorry that my PR causes so much trouble 😢.