npm 无法在webstorm上安装web3(在mac上)

dgtucam1  于 2023-01-17  发布在  Storm
关注(0)|答案(1)|浏览(214)

我无法在webstorm(mac)上安装web3(1.2.4),我尝试重新安装webstorm,但没有成功,我的环境是mac os(10.14.6)和webstorm(2019.2.4)。
错误消息如下所示:

/Users/Pierogi/Library/Preferences/WebStorm2019.2/node/node-v10.16.0-darwin-x64/bin/node /Users/Pierogi/Library/Preferences/WebStorm2019.2/node/node-v10.16.0-darwin-x64/lib/node_modules/npm/bin/npm-cli.js install web3@1.2.4

Standard error:
npm WARN deprecated @types/bignumber.js@5.0.0: This is a stub types definition for bignumber.js (https://github.com/MikeMcl/bignumber.js/). bignumber.js provides its own type definitions, so you don't need @types/bignumber.js installed!
npm WARN lifecycle The node binary used for scripts is /usr/local/bin/node but npm is using /Users/Pierogi/Library/Preferences/WebStorm2019.2/node/node-v10.16.0-darwin-x64/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
In file included from ../src/addon.cpp:9:
In file included from ../src/KeccakNISTInterface.h:17:
../src/KeccakSponge.h:23:9: warning: 'ALIGN' macro redefined [-Wmacro-redefined]
#define ALIGN __attribute__ ((aligned(32)))
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/i386/param.h:83:9: note: previous definition is here
#define ALIGN(p)        __DARWIN_ALIGN(p)
        ^
../src/addon.cpp:83:11: error: no matching member function for call to 'Set'
                target->Set(className, f);
                ~~~~~~~~^~~
/Users/Pierogi/Library/Caches/node-gyp/13.1.0/include/node/v8.h:3424:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/Pierogi/Library/Caches/node-gyp/13.1.0/include/node/v8.h:3427:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
1 warning and 1 error generated.
make: *** [Release/obj.target/sha3/src/addon.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/Pierogi/Library/Preferences/WebStorm2019.2/node/node-v10.16.0-darwin-x64/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 18.7.0
gyp ERR! command "/usr/local/Cellar/node/13.1.0/bin/node" "/Users/Pierogi/Library/Preferences/WebStorm2019.2/node/node-v10.16.0-darwin-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/Pierogi/Documents/WebStorm project/191112/node_modules/sha3
gyp ERR! node -v v13.1.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 
npm WARN bookshelf@1.0.1 requires a peer of knex@>=0.15.0 <0.20.0 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sha3@1.2.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the sha3@1.2.3 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/Pierogi/.npm/_logs/2019-11-19T13_11_28_555Z-debug.log

Standard output:

> sha3@1.2.3 install /Users/Pierogi/Documents/WebStorm project/191112/node_modules/sha3
> node-gyp rebuild

  CXX(target) Release/obj.target/sha3/src/addon.o

Process finished with exit code 1
7kqas0il

7kqas0il1#

尝试通过运行以下命令安装编译器和一些支持实用程序:

xcode-select --install

相关问题