Skip to content
This repository has been archived by the owner on Aug 24, 2021. It is now read-only.

Build Fail on MacOs Mojave #279

Closed
araa47 opened this issue May 27, 2019 · 8 comments
Closed

Build Fail on MacOs Mojave #279

araa47 opened this issue May 27, 2019 · 8 comments

Comments

@araa47
Copy link

araa47 commented May 27, 2019

OS: Mac OS Mojave 10.14.4

The build seems to fail when i run npm install

Error:


node-pre-gyp info it worked if it ends with ok
node-pre-gyp verb cli [ '/usr/local/bin/node',
node-pre-gyp verb cli   '/Users/akshay/Documents/Programming/gnosis/MultiSigWallet/dapp/node_modules/node-hid/node_modules/.bin/node-pre-gyp',
node-pre-gyp verb cli   'install',
node-pre-gyp verb cli   '--fallback-to-build' ]
node-pre-gyp info using [email protected]
node-pre-gyp info using [email protected] | darwin | x64
node-pre-gyp verb command install []
node-pre-gyp info check checked for "/Users/akshay/Documents/Programming/gnosis/MultiSigWallet/dapp/node_modules/node-hid/build/Release/HID.node" (not found)
node-pre-gyp http GET https://github.com/node-hid/node-hid/releases/download/0.5.4/HID-v0.5.4-node-v64-darwin-x64.tar.gz
node-pre-gyp http 404 https://github.com/node-hid/node-hid/releases/download/0.5.4/HID-v0.5.4-node-v64-darwin-x64.tar.gz
node-pre-gyp ERR! Tried to download(404): https://github.com/node-hid/node-hid/releases/download/0.5.4/HID-v0.5.4-node-v64-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v64 ABI) (falling back to source compile with node-gyp)
node-pre-gyp http 404 status code downloading tarball https://github.com/node-hid/node-hid/releases/download/0.5.4/HID-v0.5.4-node-v64-darwin-x64.tar.gz
node-pre-gyp verb command build [ 'rebuild' ]
node-pre-gyp ERR! Tried to download(undefined): https://github.com/node-hid/node-hid/releases/download/0.5.4/HID-v0.5.4-node-v64-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v64 ABI) (falling back to source compile with node-gyp)
node-pre-gyp http Connection closed while downloading tarball file
node-pre-gyp verb command build [ 'rebuild' ]
  CC(target) Release/obj.target/hidapi/hidapi/mac/hid.o
  CC(target) Release/obj.target/hidapi/hidapi/mac/hid.o
../hidapi/mac/hid.c:252:20: warning: comparison of integers of different signs: 'CFIndex' (aka 'long') and 'size_t' (aka 'unsigned long') [-Wsign-compare]
                if (chars_copied == len)
                    ~~~~~~~~~~~~ ^  ~~~
../hidapi/mac/hid.c:252:20: warning: comparison of integers of different signs: 'CFIndex' (aka 'long') and 'size_t' (aka 'unsigned long') [-Wsign-compare]
                if (chars_copied == len)
                    ~~~~~~~~~~~~ ^  ~~~
1 warning generated.
1 warning generated.
rm: ./Release/.deps/Release/obj.target/hidapi/hidapi/mac/hid.o.d.raw: No such file or directory
make: *** [Release/obj.target/hidapi/hidapi/mac/hid.o] Error 1
gyp  LIBTOOL-STATIC Release/hidapi.a
 ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:189:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Darwin 18.5.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/akshay/Documents/Programming/gnosis/MultiSigWallet/dapp/node_modules/node-hid/build/Release/HID.node" "--module_name=HID" "--module_path=/Users/akshay/Documents/Programming/gnosis/MultiSigWallet/dapp/node_modules/node-hid/build/Release"
gyp ERR! cwd /Users/akshay/Documents/Programming/gnosis/MultiSigWallet/dapp/node_modules/node-hid
gyp ERR! node -v v10.15.3
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 build --fallback-to-build --module=/Users/akshay/Documents/Programming/gnosis/MultiSigWallet/dapp/node_modules/node-hid/build/Release/HID.node --module_name=HID --module_path=/Users/akshay/Documents/Programming/gnosis/MultiSigWallet/dapp/node_modules/node-hid/build/Release' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/akshay/Documents/Programming/gnosis/MultiSigWallet/dapp/node_modules/node-hid/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:189:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:970:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
node-pre-gyp ERR! System Darwin 18.5.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/akshay/Documents/Programming/gnosis/MultiSigWallet/dapp/node_modules/node-hid/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/akshay/Documents/Programming/gnosis/MultiSigWallet/dapp/node_modules/node-hid
node-pre-gyp ERR! node -v v10.15.3
node-pre-gyp ERR! node-pre-gyp -v v0.6.31
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 build --fallback-to-build --module=/Users/akshay/Documents/Programming/gnosis/MultiSigWallet/dapp/node_modules/node-hid/build/Release/HID.node --module_name=HID --module_path=/Users/akshay/Documents/Programming/gnosis/MultiSigWallet/dapp/node_modules/node-hid/build/Release' (1)
  CXX(target) Release/obj.target/HID/src/HID.o [email protected]~install: Failed to exec install script
../src/HID.cc:34:10: fatal error: 'hidapi.h' file not found.4~install: Failed to exec install script
#include <hidapi.h>
         ^~~~~~~~~~
1 error generated.
make: *** [Release/obj.target/HID/src/HID.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:189:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Darwin 18.5.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/akshay/Documents/Programming/gnosis/MultiSigWallet/dapp/node_modules/node-hid/build/Release/HID.node" "--module_name=HID" "--module_path=/Users/akshay/Documents/Programming/gnosis/MultiSigWallet/dapp/node_modules/node-hid/build/Release"
gyp ERR! cwd /Users/akshay/Documents/Programming/gnosis/MultiSigWallet/dapp/node_modules/node-hid
gyp ERR! node -v v10.15.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN [email protected] No repository field.
npm WARN [email protected] license should be a valid SPDX license expression

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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!     /Users/akshay/.npm/_logs/2019-05-27T07_00_00_421Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `cd dapp && npm install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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!     /Users/akshay/.npm/_logs/2019-05-27T07_00_00_559Z-debug.log

Seems to be caused by node-hid version 0.5.4

@itinance
Copy link

itinance commented Jun 7, 2019

Same here. Seems to be related to node-hid/node-hid#266.

@araa47
Copy link
Author

araa47 commented Jun 7, 2019

Thanks, will try out that solution, was using a nix environment for a temporary fix

@araa47 araa47 closed this as completed Jun 7, 2019
@PaulRBerg
Copy link

Hey @araa47 what sort of environment variable did you use?

I still cannot npm install with node v10 on Mojave.

@araa47
Copy link
Author

araa47 commented Jul 8, 2019

If i remember correctly i removed it from the package.json and then manually installed it without specifying the version.

@PaulRBerg
Copy link

It seems that is not a secure thing to do: #290 (comment)

@araa47
Copy link
Author

araa47 commented Jul 8, 2019

@PaulRBerg , thanks for raising the issue. Will flag this. Currently not using this for production. You could also try using a nix environment. My nix-shell file looks like this , this might solve the problem. Let me know.

You need to first install nix, then create a shell.nix file with the below contents. Feel free to change this according to your needs, this is the template i have with some specific dependencies on my set-up

with import (builtins.fetchTarball "https://d3g5gsiof5omrk.cloudfront.net/nixpkgs/nixpkgs-18.09pre144939.14a9ca27e69/nixexprs.tar.xz") {};

let
  nodejs = nodejs-8_x;
  nodepkgs = nodePackages_8_x;

  solc-0_4_23-tree-url = https://github.com/nixos/nixpkgs/archive/bd991be8d3cf62cc3b6c704ed0cd21b75f1ddd8a.tar.gz;
  solc-0_4_23 = ((import (builtins.fetchTarball solc-0_4_23-tree-url) {}).solc);

  solc23 = pkgs.runCommand "solc-0.4.23-wrapper" {} ''
    mkdir -p $out/bin
    echo '#!${stdenv.shell}' > $out/bin/solc23
    echo 'exec ${solc-0_4_23}/bin/solc "$@"' >> $out/bin/solc23
    chmod +x $out/bin/solc23
  '';

in mkShell rec {
  buildInputs = [
    solc solc23 go-ethereum nodejs nodepkgs.pnpm nodepkgs.mocha
  ];

  shellHook = ''
    print_module_version="console.log(process.versions.modules)"
    export npm_config_store=''${NPM_STORE_PREFIX-$HOME}/.pnpm-store-abi-$(${nodejs}/bin/node -e $print_module_version)
    '';
}

@PaulRBerg
Copy link

Interesting, I'll take a look. Is it similar to nvm?

@araa47
Copy link
Author

araa47 commented Jul 8, 2019

Its more of a functional package manager, making it easy for anyone to recreate environments regardless of running macos or linux. https://nixos.org/nix/manual/ would be a good place to start. Its an over-engineered solution for this problem though

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants