Closed jamboj closed 2 years ago
I have the same issue
+1
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 Even after installing yarn, I'm getting the same error. Is there something more to do for your workaround?
It has to be installed and globally available on your $PATH. Thats the only other caveat I can think of.
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 sha3@1.2.3
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 node-gyp@7.1.2
3825 error gyp info using node@15.5.1 | 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
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 opensea-js@1.1.11) is even relying on sha3 anymore.
What does npm ls sha3
show in your project?
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.
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.
(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).
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.
same issue here
@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
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.
unfortunately I can't fallback to node 10 as I have another dependency that requires node 14+
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.
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?
Are you using node v16+?? I got the same issue using node v16. It works after changed back to v14 LTS
Was anyone able to get this working? Having the same issues
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.
Works using node v15 for me, doesn't work with v16.
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.
This is what it worked for me as well, just using yarn instead of npm and it worked on Node v16.6.2
Confirming node v14 worked with NVM. Thank you!
👍
Issue is still present on node v16 though. Any chance of upgrading sha3 lib to solve the issue?
After further research, it seems like the issue can be fixed by using yarn instead of npm and downgrading to node v14. Looking into fixing this with v16.
The latest node LTS version is 16, not 14. Are you going to fix this? Should not be closed, since it hasn't been fixed.
Sorry, didn't mean to close. We are investigating this, but a workaround at the moment is using v14. I will comment on here once I have any updates.
Using yarn can solve this problem
npm install -g yarn yarn add opensea-js
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?