英文:
failed to run npm i with node-gyp errors
问题
I am trying to do npm i --force
, but it fails with the following error:
npm ERR! code 1
npm ERR! path /Users/moblizeit/GitHub/code-repo/apps/business-card-scanner/admin/businesscardadmin/node_modules/grpc
npm ERR! command failed
...
My package.json
file:
{
"name": "businesscardadmin",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
...
}
Please note that I can only provide the translated text. If you have specific questions or need assistance with this error, feel free to ask.
英文:
i am trying to do npm i --force and this all fails with below error
pm ERR! code 1
npm ERR! path /Users/moblizeit/GitHub/code-repo/apps/business-card-scanner/admin/businesscardadmin/node_modules/grpc
npm ERR! command failed
npm ERR! command sh -c -- node-pre-gyp install --fallback-to-build --library=static_library
npm ERR! CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o
npm ERR! CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/avl/avl.o
npm ERR! CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/backoff/backoff.o
npm ERR! CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_args.o
npm ERR! CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack.o
npm ERR! CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack_builder.o
npm ERR! CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_trace.o
npm ERR! CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channelz.o
npm ERR! CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channelz_registry.o
npm ERR! CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/connected_channel.o
npm ERR! CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/handshaker.o
npm ERR! CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/handshaker_registry.o
npm ERR! CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/status_util.o
npm ERR! CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/compression.o
npm ERR! CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/compression_args.o
npm ERR! CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/compression_internal.o
npm ERR! CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/message_compress.o
npm ERR! CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/stream_compression.o
npm ERR! CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/stream_compression_gzip.o
npm ERR! CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/stream_compression_identity.o
npm ERR! CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/debug/stats.o
npm ERR! CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/debug/stats_data.o
npm ERR! Failed to execute '/opt/homebrew/Cellar/node@16/16.20.0/bin/node /opt/homebrew/Cellar/node@16/16.20.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/Users/moblizeit/GitHub/code-repo/apps/business-card-scanner/admin/businesscardadmin/node_modules/grpc/src/node/extension_binary/node-v93-darwin-arm64-unknown/grpc_node.node --module_name=grpc_node --module_path=/Users/moblizeit/GitHub/code-repo/apps/business-card-scanner/admin/businesscardadmin/node_modules/grpc/src/node/extension_binary/node-v93-darwin-arm64-unknown --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@0.13.0
npm ERR! node-pre-gyp info using node@16.20.0 | darwin | arm64
npm ERR! node-pre-gyp WARN Using request for node-pre-gyp https download
npm ERR! node-pre-gyp info check checked for "/Users/moblizeit/GitHub/code-repo/apps/business-card-scanner/admin/businesscardadmin/node_modules/grpc/src/node/extension_binary/node-v93-darwin-arm64-unknown/grpc_node.node" (not found)
npm ERR! node-pre-gyp http GET https://node-precompiled-binaries.grpc.io/grpc/v1.23.3/node-v93-darwin-arm64-unknown.tar.gz
npm ERR! node-pre-gyp http 404 https://node-precompiled-binaries.grpc.io/grpc/v1.23.3/node-v93-darwin-arm64-unknown.tar.gz
npm ERR! node-pre-gyp WARN Tried to download(404): https://node-precompiled-binaries.grpc.io/grpc/v1.23.3/node-v93-darwin-arm64-unknown.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not found for grpc@1.23.3 and node@16.20.0 (node-v93 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp http 404 status code downloading tarball https://node-precompiled-binaries.grpc.io/grpc/v1.23.3/node-v93-darwin-arm64-unknown.tar.gz
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.1.0
npm ERR! gyp info using node@16.20.0 | darwin | arm64
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.1.0
npm ERR! gyp info using node@16.20.0 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.9.6 found at "/Applications/Xcode.app/Contents/Developer/usr/bin/python3"
npm ERR! gyp info spawn /Applications/Xcode.app/Contents/Developer/usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/opt/homebrew/Cellar/node@16/16.20.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/moblizeit/GitHub/code-repo/apps/business-card-scanner/admin/businesscardadmin/node_modules/grpc/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/opt/homebrew/Cellar/node@16/16.20.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/moblizeit/Library/Caches/node-gyp/16.20.0/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/Users/moblizeit/Library/Caches/node-gyp/16.20.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/opt/homebrew/Cellar/node@16/16.20.0/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/moblizeit/Library/Caches/node-gyp/16.20.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/moblizeit/GitHub/code-repo/apps/business-card-scanner/admin/businesscardadmin/node_modules/grpc',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.1.0
npm ERR! gyp info using node@16.20.0 | darwin | arm64
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! ../deps/grpc/src/core/lib/debug/stats_data.cc:284:5: error: suspicious concatenation of string literals in an array initialization; did you mean to separate the elements with a comma? [-Werror,-Wstring-concatenation]
npm ERR! "requested the incoming call",
npm ERR! ^
npm ERR! ../deps/grpc/src/core/lib/debug/stats_data.cc:283:5: note: place parentheses around the string literal to silence warning
npm ERR! "How many completion queues were checked looking for a CQ that had "
npm ERR! ^
npm ERR! 1 error generated.
npm ERR! make: *** [Release/obj.target/grpc/deps/grpc/src/core/lib/debug/stats_data.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.onExit (/opt/homebrew/Cellar/node@16/16.20.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:201:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)
npm ERR! gyp ERR! System Darwin 22.3.0
npm ERR! gyp ERR! command "/opt/homebrew/Cellar/node@16/16.20.0/bin/node" "/opt/homebrew/Cellar/node@16/16.20.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/Users/moblizeit/GitHub/code-repo/apps/business-card-scanner/admin/businesscardadmin/node_modules/grpc/src/node/extension_binary/node-v93-darwin-arm64-unknown/grpc_node.node" "--module_name=grpc_node" "--module_path=/Users/moblizeit/GitHub/code-repo/apps/business-card-scanner/admin/businesscardadmin/node_modules/grpc/src/node/extension_binary/node-v93-darwin-arm64-unknown" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v93"
npm ERR! gyp ERR! cwd /Users/moblizeit/GitHub/code-repo/apps/business-card-scanner/admin/businesscardadmin/node_modules/grpc
npm ERR! gyp ERR! node -v v16.20.0
npm ERR! gyp ERR! node-gyp -v v9.1.0
npm ERR! gyp ERR! not ok
npm ERR! node-pre-gyp ERR! build error
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute '/opt/homebrew/Cellar/node@16/16.20.0/bin/node /opt/homebrew/Cellar/node@16/16.20.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/Users/moblizeit/GitHub/code-repo/apps/business-card-scanner/admin/businesscardadmin/node_modules/grpc/src/node/extension_binary/node-v93-darwin-arm64-unknown/grpc_node.node --module_name=grpc_node --module_path=/Users/moblizeit/GitHub/code-repo/apps/business-card-scanner/admin/businesscardadmin/node_modules/grpc/src/node/extension_binary/node-v93-darwin-arm64-unknown --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/moblizeit/GitHub/code-repo/apps/business-card-scanner/admin/businesscardadmin/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (node:events:513:28)
npm ERR! node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1100:16)
npm ERR! node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
npm ERR! node-pre-gyp ERR! System Darwin 22.3.0
npm ERR! node-pre-gyp ERR! command "/opt/homebrew/Cellar/node@16/16.20.0/bin/node" "/Users/moblizeit/GitHub/code-repo/apps/business-card-scanner/admin/businesscardadmin/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
npm ERR! node-pre-gyp ERR! cwd /Users/moblizeit/GitHub/code-repo/apps/business-card-scanner/admin/businesscardadmin/node_modules/grpc
npm ERR! node-pre-gyp ERR! node -v v16.20.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.13.0
npm ERR! node-pre-gyp ERR! not ok
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/moblizeit/.npm/_logs/2023-05-20T13_11_17_572Z-debug-0.log
My package.json
{
"name": "businesscardadmin",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular-devkit/build-angular": "^0.803.6",
"@angular/animations": "^9.0.0-next.8",
"@angular/cdk": "^8.2.2",
"@angular/common": "~9.0.0-next.8",
"@angular/compiler": "~9.0.0-next.8",
"@angular/core": "^9.0.0-next.8",
"@angular/fire": "^5.2.1",
"@angular/flex-layout": "^8.0.0-beta.27",
"@angular/forms": "~9.0.0-next.8",
"@angular/material": "^8.2.2",
"@angular/platform-browser": "~9.0.0-next.8",
"@angular/platform-browser-dynamic": "~9.0.0-next.8",
"@angular/router": "~9.0.0-next.8",
"angular-gridster2": "^8.2.0",
"awesome-phonenumber": "^3.0.1",
"chart.js": "^2.8.0",
"core-js": "^3.2.1",
"firebase": "^7.0.0",
"firebaseui": "^4.2.0",
"firebaseui-angular": "^4.0.0",
"hammerjs": "^2.0.8",
"mat-table-exporter": "^1.2.1",
"moment": "^2.27.0",
"ng2-charts": "^2.3.0",
"ng2-org-chart": "^1.1.2",
"ngx-image-cropper": "^3.1.4",
"ngx-material-file-input": "^2.0.0",
"request": "^2.88.0",
"request-promise": "^4.2.5",
"rxjs": "~6.5.3",
"tslib": "^1.10.0",
"xlsx": "^0.15.1",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular/cli": "^8.3.6",
"@angular/compiler-cli": "~9.0.0-next.8",
"@angular/language-service": "~9.0.0-next.8",
"@types/jasmine": "~3.4.2",
"@types/jasminewd2": "~2.0.8",
"@types/node": "^12.12.47",
"codelyzer": "~5.1.2",
"forcejs": "^2.2.1",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.3.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "^2.1.0",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.2",
"protractor": "~5.4.0",
"ts-node": "~8.4.1",
"tslint": "~5.20.0",
"typescript": "^3.1.6"
},
"browser": {
"fs": false
}
}
答案1
得分: 1
你似乎对 grpc
包存在间接依赖,该包已被弃用,与最新版本的 Node 不兼容。您可能是通过 firebase
包获取此依赖。您当前依赖于版本 7.x,但最新版本是 9.22.0。升级该依赖可能会解决此错误。
英文:
You appear to have an indirect dependency on the grpc
package, which is deprecated and is not compatible with recent versions of Node. You are probably getting this dependency through the firebase
package. You have a dependency on version 7.x, but the latest release is version 9.22.0. Upgrading that dependency will probably fix this error.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论