【发布时间】:2022-03-20 17:50:48
【问题描述】:
各位,刚从 GitHub 克隆 Hyperledger Cactus 项目后,在运行“npm run configure”时出现以下错误。
机器配置:
- 苹果 M1
- 节点版本:16.14.0
- Npm 版本:8.3.1
这是控制台输出:
andre@macbook: cactus [ main ✔ ] » npm run configure
> configure
> yarn install --frozen-lockfile --non-interactive && yarn run build:dev:backend
yarn install v1.18.0
[1/4] ???? Resolving packages...
[2/4] ???? Fetching packages...
info esbuild-android-arm64@0.13.8: The platform "darwin" is incompatible with this module.
info "esbuild-android-arm64@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-darwin-64@0.13.8: The CPU architecture "arm64" is incompatible with this module.
info "esbuild-darwin-64@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-freebsd-64@0.13.8: The platform "darwin" is incompatible with this module.
info "esbuild-freebsd-64@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-freebsd-64@0.13.8: The CPU architecture "arm64" is incompatible with this module.
info esbuild-freebsd-arm64@0.13.8: The platform "darwin" is incompatible with this module.
info "esbuild-freebsd-arm64@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-linux-32@0.13.8: The platform "darwin" is incompatible with this module.
info "esbuild-linux-32@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-linux-32@0.13.8: The CPU architecture "arm64" is incompatible with this module.
info esbuild-linux-64@0.13.8: The platform "darwin" is incompatible with this module.
info "esbuild-linux-64@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-linux-64@0.13.8: The CPU architecture "arm64" is incompatible with this module.
info esbuild-linux-arm@0.13.8: The platform "darwin" is incompatible with this module.
info "esbuild-linux-arm@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-linux-arm@0.13.8: The CPU architecture "arm64" is incompatible with this module.
info esbuild-linux-arm64@0.13.8: The platform "darwin" is incompatible with this module.
info "esbuild-linux-arm64@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-linux-mips64le@0.13.8: The platform "darwin" is incompatible with this module.
info "esbuild-linux-mips64le@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-linux-mips64le@0.13.8: The CPU architecture "arm64" is incompatible with this module.
info esbuild-linux-ppc64le@0.13.8: The platform "darwin" is incompatible with this module.
info "esbuild-linux-ppc64le@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-linux-ppc64le@0.13.8: The CPU architecture "arm64" is incompatible with this module.
info esbuild-netbsd-64@0.13.8: The platform "darwin" is incompatible with this module.
info "esbuild-netbsd-64@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-netbsd-64@0.13.8: The CPU architecture "arm64" is incompatible with this module.
info esbuild-openbsd-64@0.13.8: The platform "darwin" is incompatible with this module.
info "esbuild-openbsd-64@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-openbsd-64@0.13.8: The CPU architecture "arm64" is incompatible with this module.
info esbuild-sunos-64@0.13.8: The platform "darwin" is incompatible with this module.
info "esbuild-sunos-64@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-sunos-64@0.13.8: The CPU architecture "arm64" is incompatible with this module.
info esbuild-windows-32@0.13.8: The platform "darwin" is incompatible with this module.
info "esbuild-windows-32@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-windows-32@0.13.8: The CPU architecture "arm64" is incompatible with this module.
info esbuild-windows-64@0.13.8: The platform "darwin" is incompatible with this module.
info "esbuild-windows-64@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-windows-64@0.13.8: The CPU architecture "arm64" is incompatible with this module.
info esbuild-windows-arm64@0.13.8: The platform "darwin" is incompatible with this module.
info "esbuild-windows-arm64@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] ???? Linking dependencies...
warning "workspace-aggregator-ffaefa8e-f2f8-475c-8b99-79a6efe75c20 > @hyperledger/cactus-example-carbon-accounting-frontend > @ionic-native/core@5.35.0" has incorrect peer dependency "rxjs@^5.5.0 || ^6.5.0".
warning "workspace-aggregator-ffaefa8e-f2f8-475c-8b99-79a6efe75c20 > @hyperledger/cactus-example-carbon-accounting-frontend > @ionic-native/splash-screen@5.35.0" has incorrect peer dependency "rxjs@^5.5.0 || ^6.5.0".
warning "workspace-aggregator-ffaefa8e-f2f8-475c-8b99-79a6efe75c20 > @hyperledger/cactus-example-carbon-accounting-frontend > @ionic-native/status-bar@5.35.0" has incorrect peer dependency "rxjs@^5.5.0 || ^6.5.0".
warning "workspace-aggregator-ffaefa8e-f2f8-475c-8b99-79a6efe75c20 > @hyperledger/cactus-example-carbon-accounting-frontend > @ionic/angular-toolkit@4.0.0" has unmet peer dependency "@angular-devkit/architect@^0.1200.0".
warning "workspace-aggregator-ffaefa8e-f2f8-475c-8b99-79a6efe75c20 > @hyperledger/cactus-example-carbon-accounting-frontend > @ionic/angular-toolkit@4.0.0" has unmet peer dependency "@angular-devkit/schematics@^12.0.0".
[4/4] ???? Building fresh packages...
[10/40] ⠄ pkcs11js
[2/40] ⠄ electron
[3/40] ⠄ grpc-tools
[6/40] ⠄ secp256k1
error /Users/andre/Documents/cactus/node_modules/grpc-tools: Command failed.
Exit code: 1
Command: node-pre-gyp install
Arguments:
Directory: /Users/andre/Documents/cactus/node_modules/grpc-tools
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@1.0.6
node-pre-gyp info using node@16.14.0 | darwin | arm64
node-pre-gyp info check checked for "/Users/andre/Documents/cactus/node_modules/grpc-tools/bin/grpc_tools.node" (not found)
node-pre-gyp http GET https://node-precompiled-binaries.grpc.io/grpc-tools/v1.11.2/darwin-arm64.tar.gz
node-pre-gyp ERR! install response status 404 Not Found on https://node-precompiled-binaries.grpc.io/grpc-tools/v1.11.2/darwin-arm64.tar.gz
node-pre-gyp ERR! install error
node-pre-gyp ERR! stack Error: response status 404 Not Found on https://node-precompiled-binaries.grpc.io/grpc-tools/v1.11.2/darwin-arm64.tar.gz
node-pre-gyp ERR! stack at /Users/andre/Documents/cactus/node_modules/@mapbox/node-pre-gyp/lib/install.js:67:15
node-pre-gyp ERR! stack at processTicksAndRejections (node:internal/process/task_queues:96:5)
node-pre-gyp ERR! System Darwin 21.2.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/andre/Documents/cactus/node_modules/grpc-tools/node_modules/.bin/node-pre-gyp" "install"
node-pre-gyp ERR! cwd /Users/andre/Documents/cactus/node_modules/grpc-tools
node-pre-gyp ERR! node -v v16.14.0
node-pre-gyp ERR! node-pre-gyp -v v1.0.6
warning Error running install script for optional dependency: "/Users/andre/Documents/cactus/node_modules/cpu-features: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: /Users/andre/Documents/cactus/node_modules/cpu-features
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@7.1.2
gyp info using node@16.14.0 | darwin | arm64
gyp info find Python using Python version 3.9.10 found at \"/opt/homebrew/opt/python@3.9/bin/python3.9\"
gyp http GET https://nodejs.org/download/release/v16.14.0/node-v16.14.0-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v16.14.0/node-v16.14.0-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v16.14.0/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v16.14.0/SHASUMS256.txt
(node:56976) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
(Use `node --trace-deprecation ...` to show where the warning was created)
gyp info spawn /opt/homebrew/opt/python@3.9/bin/python3.9
gyp info spawn args [
gyp info spawn args '/Users/andre/Documents/cactus/node_modules/@npmcli/run-script/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/Users/andre/Documents/cactus/node_modules/cpu-features/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/andre/Documents/cactus/node_modules/@npmcli/run-script/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/andre/Library/Caches/node-gyp/16.14.0/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Users/andre/Library/Caches/node-gyp/16.14.0',
gyp info spawn args '-Dnode_gyp_dir=/Users/andre/Documents/cactus/node_modules/@npmcli/run-script/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/andre/Library/Caches/node-gyp/16.14.0/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/andre/Documents/cactus/node_modules/cpu-features',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
ACTION Configuring dependencies /Users/andre/Documents/cactus/node_modules/cpu-features/deps/cpu_features/build/Makefile
-- The C compiler identification is AppleClang 13.0.0.13000029
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for dlfcn.h
-- Looking for dlfcn.h - found
-- Looking for getauxval
-- Looking for getauxval - not found
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/andre/Documents/cactus/node_modules/cpu-features/deps/cpu_features/build
TOUCH Release/obj.target/config_deps.stamp
ACTION Building dependencies /Users/andre/Documents/cactus/node_modules/cpu-features/deps/cpu_features/build/libcpu_features.a
gmake[1]: Entering directory '/Users/andre/Documents/cactus/node_modules/cpu-features/deps/cpu_features/build'
gmake[2]: Entering directory '/Users/andre/Documents/cactus/node_modules/cpu-features/deps/cpu_features/build'
gmake[3]: Entering directory '/Users/andre/Documents/cactus/node_modules/cpu-features/deps/cpu_features/build'
gmake[3]: Leaving directory '/Users/andre/Documents/cactus/node_modules/cpu-features/deps/cpu_features/build'
gmake[3]: Entering directory '/Users/andre/Documents/cactus/node_modules/cpu-features/deps/cpu_features/build'
[ 11%] Building C object CMakeFiles/utils.dir/src/filesystem.c.o
[ 22%] Building C object CMakeFiles/utils.dir/src/stack_line_reader.c.o
[ 33%] Building C object CMakeFiles/utils.dir/src/string_view.c.o
gmake[3]: Leaving directory '/Users/andre/Documents/cactus/node_modules/cpu-features/deps/cpu_features/build'
[ 33%] Built target utils
gmake[3]: Entering directory '/Users/andre/Documents/cactus/node_modules/cpu-features/deps/cpu_features/build'
gmake[3]: Leaving directory '/Users/andre/Documents/cactus/node_modules/cpu-features/deps/cpu_features/build'
gmake[3]: Entering directory '/Users/andre/Documents/cactus/node_modules/cpu-features/deps/cpu_features/build'
[ 44%] Building C object CMakeFiles/unix_based_hardware_detection.dir/src/hwcaps.c.o
[ 55%] Building C object CMakeFiles/unix_based_hardware_detection.dir/src/unix_features_aggregator.c.o
gmake[3]: Leaving directory '/Users/andre/Documents/cactus/node_modules/cpu-features/deps/cpu_features/build'
[ 55%] Built target unix_based_hardware_detection
gmake[3]: Entering directory '/Users/andre/Documents/cactus/node_modules/cpu-features/deps/cpu_features/build'
gmake[3]: Leaving directory '/Users/andre/Documents/cactus/node_modules/cpu-features/deps/cpu_features/build'
gmake[3]: Entering directory '/Users/andre/Documents/cactus/node_modules/cpu-features/deps/cpu_features/build'
[ 66%] Building C object CMakeFiles/cpu_features.dir/src/cpuinfo_arm.c.o
In file included from /Users/andre/Documents/cactus/node_modules/cpu-features/deps/cpu_features/src/cpuinfo_arm.c:15:
/Users/andre/Documents/cactus/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_arm.h:118:2: error: \"Including cpuinfo_arm.h from a non-arm target.\"
#error \"Including cpuinfo_arm.h from a non-arm target.\"
^
1 error generated.
gmake[3]: *** [CMakeFiles/cpu_features.dir/build.make:76: CMakeFiles/cpu_features.dir/src/cpuinfo_arm.c.o] Error 1
gmake[3]: Leaving directory '/Users/andre/Documents/cactus/node_modules/cpu-features/deps/cpu_features/build'
gmake[2]: *** [CMakeFiles/Makefile2:142: CMakeFiles/cpu_features.dir/all] Error 2
gmake[2]: Leaving directory '/Users/andre/Documents/cactus/node_modules/cpu-features/deps/cpu_features/build'
gmake[1]: *** [Makefile:136: all] Error 2
gmake[1]: Leaving directory '/Users/andre/Documents/cactus/node_modules/cpu-features/deps/cpu_features/build'
make: *** [/Users/andre/Documents/cactus/node_modules/cpu-features/deps/cpu_features/build/libcpu_features.a] Error 2
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/andre/Documents/cactus/node_modules/@npmcli/run-script/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (node:events:520:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Darwin 21.2.0
gyp ERR! command \"/usr/local/bin/node\" \"/Users/andre/Documents/cactus/node_modules/.bin/node-gyp\" \"rebuild\"
gyp ERR! cwd /Users/andre/Documents/cactus/node_modules/cpu-features
gyp ERR! node -v v16.14.0
gyp ERR! node-gyp -v v7.1.2
gyp ERR! not ok"
info This module is OPTIONAL, you can safely ignore this error
已经尝试安装node-pre-gyp,但我认为这可能与CPU架构有关。
你有什么建议吗? 提前谢谢你。
【问题讨论】:
-
您使用的是 ARM Mac 吗? (我从标签猜测是的,但想先确定)
-
@Peter 是的,它是 ARM Mac。解决方案可以在 this post 中找到,它通过 Rosetta 终端安装
nvm,从 x86_64 应用程序进行翻译。 -
@Slimas9 你应该把它写成答案,并从 cmets 中提升知识。这将使人们在未来更容易解决这个问题。
标签: node.js linux npm arm hyperledger