opensea-js icon indicating copy to clipboard operation
opensea-js copied to clipboard

npm install fails on Mac OS X

Open jamboj opened this issue 5 years ago • 29 comments

Mac OS X 10.15.7 node 15.10.0 when trying to install I'm getting the below wall of errors that I can't quite understand.. anyone can help please?

lapt1:[email protected] adm1$ npm install --save opensea-js
npm WARN deprecated [email protected]: Renamed to @metamask/safe-event-emitter
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated [email protected]: Custom ALPHABET bug fixed in v7.0.2
npm WARN deprecated [email protected]: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command /usr/local/bin/node /usr/local/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/Users/adm1/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm ERR! npm WARN deprecated [email protected]: Renamed to @metamask/safe-event-emitter
npm ERR! npm WARN deprecated [email protected]: this library is no longer supported
npm ERR! npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm ERR! npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm ERR! npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm ERR! npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm ERR! npm WARN deprecated [email protected]: Package no longer supported. Contact [email protected] for more info.
npm ERR! npm WARN deprecated [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm ERR! npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! npm WARN deprecated [email protected]: Custom ALPHABET bug fixed in v7.0.2
npm ERR! npm WARN deprecated [email protected]: This version of 'buffer' is out-of-date. You must update to v4.9.2 or newer
npm ERR! npm WARN deprecated [email protected]: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
npm ERR! npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm ERR! npm ERR! code 1
npm ERR! npm ERR! path /Users/adm1/.npm/_cacache/tmp/git-clone-74cc97c0/node_modules/sha3
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command sh -c node-gyp rebuild
npm ERR! npm ERR! CXX(target) Release/obj.target/sha3/src/addon.o
npm ERR! npm ERR! gyp info it worked if it ends with ok
npm ERR! npm ERR! gyp info using [email protected]
npm ERR! npm ERR! gyp info using [email protected] | darwin | x64
npm ERR! npm ERR! gyp info find Python using Python version 3.8.2 found at "/Library/Developer/CommandLineTools/usr/bin/python3"
npm ERR! npm ERR! gyp info spawn /Library/Developer/CommandLineTools/usr/bin/python3
npm ERR! npm ERR! gyp info spawn args [
npm ERR! npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! npm ERR! gyp info spawn args   '-f',
npm ERR! npm ERR! gyp info spawn args   'make',
npm ERR! npm ERR! gyp info spawn args   '-I',
npm ERR! npm ERR! gyp info spawn args   '/Users/adm1/.npm/_cacache/tmp/git-clone-74cc97c0/node_modules/sha3/build/config.gypi',
npm ERR! npm ERR! gyp info spawn args   '-I',
npm ERR! npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! npm ERR! gyp info spawn args   '-I',
npm ERR! npm ERR! gyp info spawn args   '/Users/adm1/Library/Caches/node-gyp/15.10.0/include/node/common.gypi',
npm ERR! npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! npm ERR! gyp info spawn args   '-Dnode_root_dir=/Users/adm1/Library/Caches/node-gyp/15.10.0',
npm ERR! npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/adm1/Library/Caches/node-gyp/15.10.0/<(target_arch)/node.lib',
npm ERR! npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/adm1/.npm/_cacache/tmp/git-clone-74cc97c0/node_modules/sha3',
npm ERR! npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! npm ERR! gyp info spawn args   '--depth=.',
npm ERR! npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! npm ERR! gyp info spawn args   '--generator-output',
npm ERR! npm ERR! gyp info spawn args   'build',
npm ERR! npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! npm ERR! gyp info spawn args ]
npm ERR! npm ERR! No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.
npm ERR! npm ERR! No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.
npm ERR! npm ERR! No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.
npm ERR! npm ERR! 
npm ERR! npm ERR! 
npm ERR! npm ERR! 
npm ERR! npm ERR! gyp info spawn make
npm ERR! npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! npm ERR! In file included from ../src/addon.cpp:4:
npm ERR! npm ERR! In file included from ../node_modules/nan/nan.h:2818:
npm ERR! npm ERR! ../node_modules/nan/nan_typedarray_contents.h:34:43: warning: 'GetContents' is deprecated: Use GetBackingStore. See http://crbug.com/v8/9908. [-Wdeprecated-declarations]
npm ERR! npm ERR!       data   = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
npm ERR! npm ERR!                                           ^
npm ERR! npm ERR! /Users/adm1/Library/Caches/node-gyp/15.10.0/include/node/v8.h:5317:3: note: 'GetContents' has been explicitly marked deprecated here
npm ERR! npm ERR!   V8_DEPRECATE_SOON("Use GetBackingStore. See http://crbug.com/v8/9908.")
npm ERR! npm ERR!   ^
npm ERR! npm ERR! /Users/adm1/Library/Caches/node-gyp/15.10.0/include/node/v8config.h:402:39: note: expanded from macro 'V8_DEPRECATE_SOON'
npm ERR! npm ERR! # define V8_DEPRECATE_SOON(message) [[deprecated(message)]]
npm ERR! npm ERR!                                       ^
npm ERR! npm ERR! In file included from ../src/addon.cpp:9:
npm ERR! npm ERR! In file included from ../src/KeccakNISTInterface.h:17:
npm ERR! npm ERR! ../src/KeccakSponge.h:23:9: warning: 'ALIGN' macro redefined [-Wmacro-redefined]
npm ERR! npm ERR! #define ALIGN __attribute__ ((aligned(32)))
npm ERR! npm ERR!         ^
npm ERR! npm ERR! /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/i386/param.h:83:9: note: previous definition is here
npm ERR! npm ERR! #define ALIGN(p)        __DARWIN_ALIGN(p)
npm ERR! npm ERR!         ^
npm ERR! npm ERR! ../src/addon.cpp:83:11: error: no matching member function for call to 'Set'
npm ERR! npm ERR!                 target->Set(className, f);
npm ERR! npm ERR!                 ~~~~~~~~^~~
npm ERR! npm ERR! /Users/adm1/Library/Caches/node-gyp/15.10.0/include/node/v8.h:3716:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR! npm ERR!   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR! npm ERR!                                     ^
npm ERR! npm ERR! /Users/adm1/Library/Caches/node-gyp/15.10.0/include/node/v8.h:3719:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR! npm ERR!   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR! npm ERR!                                     ^
npm ERR! npm ERR! 2 warnings and 1 error generated.
npm ERR! npm ERR! make: *** [Release/obj.target/sha3/src/addon.o] Error 1
npm ERR! npm ERR! gyp ERR! build error 
npm ERR! npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! npm ERR! gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:378:20)
npm ERR! npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! npm ERR! gyp ERR! System Darwin 19.6.0
npm ERR! npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! npm ERR! gyp ERR! cwd /Users/adm1/.npm/_cacache/tmp/git-clone-74cc97c0/node_modules/sha3
npm ERR! npm ERR! gyp ERR! node -v v15.10.0
npm ERR! npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! npm ERR! gyp ERR! not ok

jamboj avatar Mar 15 '21 13:03 jamboj

I have the same issue

yossigruner avatar Mar 15 '21 20:03 yossigruner

+1

fernandoherlo avatar Mar 18 '21 13:03 fernandoherlo

I created a pull request to address this:

https://github.com/ProjectOpenSea/wyvern-schemas/pull/3

The workaround is to install yarn, though this is an issue with the dependency tree.

bcomnes avatar Mar 28 '21 18:03 bcomnes

@bcomnes Even after installing yarn, I'm getting the same error. Is there something more to do for your workaround?

jarednielsen avatar Mar 30 '21 17:03 jarednielsen

It has to be installed and globally available on your $PATH. Thats the only other caveat I can think of.

bcomnes avatar Mar 30 '21 17:03 bcomnes

Yep, available globally within $PATH, even from a fresh terminal. Posting the error below if you have any additional insights:

3812 timing command:install Completed in 32688ms
3813 verbose stack Error: command failed
3813 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
3813 verbose stack     at ChildProcess.emit (node:events:376:20)
3813 verbose stack     at maybeClose (node:internal/child_process:1063:16)
3813 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:295:5)
3814 verbose pkgid [email protected]
3815 verbose cwd /Users/nieljare/.npm/_cacache/tmp/git-clone-2f85d00a
3816 verbose Darwin 19.6.0
3817 verbose argv "/usr/local/Cellar/node/15.5.1/bin/node" "/usr/local/lib/node_modules/npm/bin/npm-cli.js" "install" "--cache=/Users/nieljare/.npm/_cacache" "--prefer-offline=false" "--prefer-online=false" "--offline=false" "--no-progress" "--no-save" "--no-audit"
3818 verbose node v15.5.1
3819 verbose npm  v7.3.0
3820 error code 1
3821 error path /Users/nieljare/.npm/_cacache/tmp/git-clone-2f85d00a/node_modules/sha3
3822 error command failed
3823 error command sh -c node-gyp rebuild
3824 error CXX(target) Release/obj.target/sha3/src/addon.o
3825 error gyp info it worked if it ends with ok
3825 error gyp info using [email protected]
3825 error gyp info using [email protected] | darwin | x64
3825 error gyp info find Python using Python version 3.7.9 found at "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3"
3825 error gyp info spawn /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
3825 error gyp info spawn args [
3825 error gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
3825 error gyp info spawn args   'binding.gyp',
3825 error gyp info spawn args   '-f',
3825 error gyp info spawn args   'make',
3825 error gyp info spawn args   '-I',
3825 error gyp info spawn args   '/Users/nieljare/.npm/_cacache/tmp/git-clone-2f85d00a/node_modules/sha3/build/config.gypi',
3825 error gyp info spawn args   '-I',
3825 error gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
3825 error gyp info spawn args   '-I',
3825 error gyp info spawn args   '/Users/nieljare/Library/Caches/node-gyp/15.5.1/include/node/common.gypi',
3825 error gyp info spawn args   '-Dlibrary=shared_library',
3825 error gyp info spawn args   '-Dvisibility=default',
3825 error gyp info spawn args   '-Dnode_root_dir=/Users/nieljare/Library/Caches/node-gyp/15.5.1',
3825 error gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
3825 error gyp info spawn args   '-Dnode_lib_file=/Users/nieljare/Library/Caches/node-gyp/15.5.1/<(target_arch)/node.lib',
3825 error gyp info spawn args   '-Dmodule_root_dir=/Users/nieljare/.npm/_cacache/tmp/git-clone-2f85d00a/node_modules/sha3',
3825 error gyp info spawn args   '-Dnode_engine=v8',
3825 error gyp info spawn args   '--depth=.',
3825 error gyp info spawn args   '--no-parallel',
3825 error gyp info spawn args   '--generator-output',
3825 error gyp info spawn args   'build',
3825 error gyp info spawn args   '-Goutput_dir=.'
3825 error gyp info spawn args ]
3825 error gyp info spawn make
3825 error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
3825 error In file included from ../src/addon.cpp:4:
3825 error In file included from ../node_modules/nan/nan.h:2818:
3825 error ../node_modules/nan/nan_typedarray_contents.h:34:43: warning: 'GetContents' is deprecated: Use GetBackingStore. See http://crbug.com/v8/9908. [-Wdeprecated-declarations]
3825 error       data   = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
3825 error                                           ^
3825 error /Users/nieljare/Library/Caches/node-gyp/15.5.1/include/node/v8.h:5317:3: note: 'GetContents' has been explicitly marked deprecated here
3825 error   V8_DEPRECATE_SOON("Use GetBackingStore. See http://crbug.com/v8/9908.")
3825 error   ^
3825 error /Users/nieljare/Library/Caches/node-gyp/15.5.1/include/node/v8config.h:402:39: note: expanded from macro 'V8_DEPRECATE_SOON'
3825 error # define V8_DEPRECATE_SOON(message) [[deprecated(message)]]
3825 error                                       ^
3825 error In file included from ../src/addon.cpp:9:
3825 error In file included from ../src/KeccakNISTInterface.h:17:
3825 error ../src/KeccakSponge.h:23:9: warning: 'ALIGN' macro redefined [-Wmacro-redefined]
3825 error #define ALIGN __attribute__ ((aligned(32)))
3825 error         ^
3825 error /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/i386/param.h:83:9: note: previous definition is here
3825 error #define ALIGN(p)        __DARWIN_ALIGN(p)
3825 error         ^
3825 error ../src/addon.cpp:83:11: error: no matching member function for call to 'Set'
3825 error                 target->Set(className, f);
3825 error                 ~~~~~~~~^~~
3825 error /Users/nieljare/Library/Caches/node-gyp/15.5.1/include/node/v8.h:3716:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
3825 error   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
3825 error                                     ^
3825 error /Users/nieljare/Library/Caches/node-gyp/15.5.1/include/node/v8.h:3719:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
3825 error   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
3825 error                                     ^
3825 error 2 warnings and 1 error generated.
3825 error make: *** [Release/obj.target/sha3/src/addon.o] Error 1
3825 error gyp ERR! build error
3825 error gyp ERR! stack Error: `make` failed with exit code: 2
3825 error gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
3825 error gyp ERR! stack     at ChildProcess.emit (node:events:376:20)
3825 error gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:284:12)
3825 error gyp ERR! System Darwin 19.6.0
3825 error gyp ERR! command "/usr/local/Cellar/node/15.5.1/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
3825 error gyp ERR! cwd /Users/nieljare/.npm/_cacache/tmp/git-clone-2f85d00a/node_modules/sha3
3825 error gyp ERR! node -v v15.5.1
3825 error gyp ERR! node-gyp -v v7.1.2
3825 error gyp ERR! not ok
3826 verbose exit 1

jarednielsen avatar Mar 30 '21 17:03 jarednielsen

Oh you are right. that is a different issue.

You are missing a build tool for building a native addon for the package sha3. But sha3 ships a pure JS version now in 2.0. Also it doesnt appear opensea (at least [email protected]) is even relying on sha3 anymore.

What does npm ls sha3 show in your project?

bcomnes avatar Mar 30 '21 18:03 bcomnes

At first it was (empty), but I ran npm install sha3 and now I have version 2.1.4, but still getting the same error.

jarednielsen avatar Mar 30 '21 18:03 jarednielsen

Strange. The path that made it look like that package was the issue was this

'/Users/nieljare/.npm/_cacache/tmp/git-clone-2f85d00a/node_modules/sha3/build/config.gypi

Looks like its using git cloned dependencies so maybe try clearing your npm cache.

bcomnes avatar Mar 30 '21 19:03 bcomnes

(Another issue with this package seems to be reliance on non-immutible packages due to its reliance on floating git dependencies... not a good practice if you want reliability).

bcomnes avatar Mar 30 '21 19:03 bcomnes

I ran this:

npm uninstall sha3
npm uninstall node-gyp
npm uninstall opensea-js
npm cache clean --force
npm install sha3
sudo npm explore npm -g -- npm install node-gyp@latest
npm install --save opensea-js

Still the same error. I agree with you that not pinning Git dependencies is an issue.

jarednielsen avatar Mar 30 '21 19:03 jarednielsen

same issue here

johangace avatar Mar 30 '21 20:03 johangace

@jamboj While it's not ideal, according to the .nvmrc you probably need to use node ~10 (https://github.com/ProjectOpenSea/opensea-js/blob/master/.nvmrc) and not 15.

You can try running nvm use (need to install the version from .nvmrc first using nvm install v10.19.0 and ofc setup nvm if you don't have it: https://github.com/nvm-sh/nvm) in root of the project and then try to install to see if it helps

MetarDev avatar Mar 31 '21 06:03 MetarDev

I'm running 15 and it works. I'm not sure which build tools I have though. Running an older version might help though if you are having issues.

I'm curious where this native version of sha3 is originating though because I'm not seeing it, and it looks like its coming out of a git cloned dependency.

bcomnes avatar Mar 31 '21 15:03 bcomnes

unfortunately I can't fallback to node 10 as I have another dependency that requires node 14+

jamboj avatar Apr 01 '21 17:04 jamboj

I ran into the same issue and the only thing that worked for me was to use yarn instead of npm.

I did not need to install sha3 and it worked using node v14.16.1 as long as I used yarn.

jeremyjs avatar Apr 16 '21 04:04 jeremyjs

I ran into the same issue and the only thing that worked for me was to use yarn instead of npm.

I did not need to install sha3 and it worked using node v14.16.1 as long as I used yarn.

What command did you use to install with yarn?

jarednielsen avatar Apr 16 '21 05:04 jarednielsen

Are you using node v16+?? I got the same issue using node v16. It works after changed back to v14 LTS

ElvisWong avatar Jul 02 '21 02:07 ElvisWong

Was anyone able to get this working? Having the same issues

snaptopixel avatar Jul 20 '21 15:07 snaptopixel

I ran into the same issue and the only thing that worked for me was to use yarn instead of npm. I did not need to install sha3 and it worked using node v14.16.1 as long as I used yarn.

What command did you use to install with yarn?

First, I set the node version to a v14 version; for instance, v14.17.1 worked for me.

Then, I just ran yarn install and it worked.

jeremyjs avatar Jul 26 '21 17:07 jeremyjs