npm-install命令生成node-pre-gyp ERR!构建错误



我正在尝试从旧版本运行项目。每当我运行命令npm install,它总是得到错误。我不知道这里发生了什么。当我创建一个新项目时,一切都很顺利。希望有人能帮我解决这个问题?我是nodejs的新手。我试图按照文档安装nodejs。当使用NPM install命令安装依赖项时,我遇到了一个错误。

npm WARN deprecated core-js@2.6.12: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated core-js@3.0.1: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm ERR! code 1
npm ERR! path D:projectstask-managementfrontendnode_modulesgrpc
npm ERR! command failed
npm ERR! command C:Windowssystem32cmd.exe /d /s /c C:UsersdpoitAppDataLocalTempinstall-1656322977670.cmd
npm ERR! Failed to execute 'C:Program Filesnodejsnode.exe C:UsersdpoitAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gypbinnode-gyp.js configure --fallback-to-build --library=static_library --module=D:projectstask-managementfrontendnode_modulesgrpcsrcnodeextension_binarynode-v93-win32-x64-unknowngrpc_node.node --module_name=grpc_node --module_path=D:projectstask-managementfrontendnode_modulesgrpcsrcnodeextension_binarynode-v93-win32-x64-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.12.0
npm ERR! node-pre-gyp info using node@16.15.1 | win32 | x64
npm ERR! node-pre-gyp WARN Using request for node-pre-gyp https download
npm ERR! node-pre-gyp info check checked for "D:projectstask-managementfrontendnode_modulesgrpcsrcnodeextension_binarynode-v93-win32-x64-unknowngrpc_node.node" (not found)
npm ERR! node-pre-gyp http GET https://node-precompiled-binaries.grpc.io/grpc/v1.20.0/node-v93-win32-x64-unknown.tar.gz      
npm ERR! node-pre-gyp http 404 https://node-precompiled-binaries.grpc.io/grpc/v1.20.0/node-v93-win32-x64-unknown.tar.gz      
npm ERR! node-pre-gyp WARN Tried to download(404): https://node-precompiled-binaries.grpc.io/grpc/v1.20.0/node-v93-win32-x64-unknown.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not found for grpc@1.20.0 and node@16.15.1 (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.20.0/node-v93-win32-x64-unknown.tar.gz
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.0.0
npm ERR! gyp info using node@16.15.1 | win32 | x64
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.0.0
npm ERR! gyp info using node@16.15.1 | win32 | x64
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration
npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
npm ERR! gyp ERR! find Python checking if "python3" can be used
npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if "python" can be used
npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if Python is C:UsersdpoitAppDataLocalProgramsPythonPython39python.exe
npm ERR! gyp ERR! find Python - "C:UsersdpoitAppDataLocalProgramsPythonPython39python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:Program FilesPython39python.exe
npm ERR! gyp ERR! find Python - "C:Program FilesPython39python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:UsersdpoitAppDataLocalProgramsPythonPython39-32python.exe      
npm ERR! gyp ERR! find Python - "C:UsersdpoitAppDataLocalProgramsPythonPython39-32python.exe" could not be run       
npm ERR! gyp ERR! find Python checking if Python is C:Program FilesPython39-32python.exe
npm ERR! gyp ERR! find Python - "C:Program FilesPython39-32python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:Program Files (x86)Python39-32python.exe
npm ERR! gyp ERR! find Python - "C:Program Files (x86)Python39-32python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:UsersdpoitAppDataLocalProgramsPythonPython38python.exe
npm ERR! gyp ERR! find Python - "C:UsersdpoitAppDataLocalProgramsPythonPython38python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:Program FilesPython38python.exe
npm ERR! gyp ERR! find Python - "C:Program FilesPython38python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:UsersdpoitAppDataLocalProgramsPythonPython38-32python.exe      
npm ERR! gyp ERR! find Python - "C:UsersdpoitAppDataLocalProgramsPythonPython38-32python.exe" could not be run       
npm ERR! gyp ERR! find Python checking if Python is C:Program FilesPython38-32python.exe
npm ERR! gyp ERR! find Python - "C:Program FilesPython38-32python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:Program Files (x86)Python38-32python.exe
npm ERR! gyp ERR! find Python - "C:Program Files (x86)Python38-32python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:UsersdpoitAppDataLocalProgramsPythonPython37python.exe
npm ERR! gyp ERR! find Python - "C:UsersdpoitAppDataLocalProgramsPythonPython37python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:Program FilesPython37python.exe
npm ERR! gyp ERR! find Python - "C:Program FilesPython37python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:UsersdpoitAppDataLocalProgramsPythonPython37-32python.exe      
npm ERR! gyp ERR! find Python - "C:UsersdpoitAppDataLocalProgramsPythonPython37-32python.exe" could not be run       
npm ERR! gyp ERR! find Python checking if Python is C:Program FilesPython37-32python.exe
npm ERR! gyp ERR! find Python - "C:Program FilesPython37-32python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:Program Files (x86)Python37-32python.exe
npm ERR! gyp ERR! find Python - "C:Program Files (x86)Python37-32python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:UsersdpoitAppDataLocalProgramsPythonPython36python.exe
npm ERR! gyp ERR! find Python - "C:UsersdpoitAppDataLocalProgramsPythonPython36python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:Program FilesPython36python.exe
npm ERR! gyp ERR! find Python - "C:Program FilesPython36python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:UsersdpoitAppDataLocalProgramsPythonPython36-32python.exe      
npm ERR! gyp ERR! find Python - "C:UsersdpoitAppDataLocalProgramsPythonPython36-32python.exe" could not be run       
npm ERR! gyp ERR! find Python checking if Python is C:Program FilesPython36-32python.exe
npm ERR! gyp ERR! find Python - "C:Program FilesPython36-32python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:Program Files (x86)Python36-32python.exe
npm ERR! gyp ERR! find Python - "C:Program Files (x86)Python36-32python.exe" could not be run
npm ERR! gyp ERR! find Python checking if the py launcher can be used to find Python 3
npm ERR! gyp ERR! find Python - "py.exe" is not in PATH or produced an error
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python You need to install the latest version of Python.
npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
npm ERR! gyp ERR! find Python you can try one of the following options:
npm ERR! gyp ERR! find Python - Use the switch --python="C:PathTopython.exe"
npm ERR! gyp ERR! find Python   (accepted by both node-gyp and npm)
npm ERR! gyp ERR! find Python - Set the environment variable PYTHON
npm ERR! gyp ERR! find Python - Set the npm configuration variable python:
npm ERR! gyp ERR! find Python   npm config set python "C:PathTopython.exe"
npm ERR! gyp ERR! find Python For more information consult the documentation at:
npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Python installation to use
npm ERR! gyp ERR! stack     at PythonFinder.fail (C:UsersdpoitAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gyplibfind-python.js:330:47)
npm ERR! gyp ERR! stack     at PythonFinder.runChecks (C:UsersdpoitAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gyplibfind-python.js:159:21)
npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (C:UsersdpoitAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gyplibfind-python.js:228:18)
npm ERR! gyp ERR! stack     at PythonFinder.execFileCallback (C:UsersdpoitAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gyplibfind-python.js:294:16)
npm ERR! gyp ERR! stack     at exithandler (node:child_process:406:5)
npm ERR! gyp ERR! stack     at ChildProcess.errorhandler (node:child_process:418:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
npm ERR! gyp ERR! stack     at onErrorNT (node:internal/child_process:478:16)
npm ERR! gyp ERR! stack     at processTicksAndRejections (node:internal/process/task_queues:83:21)
npm ERR! gyp ERR! System Windows_NT 10.0.19042
npm ERR! gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\dpoit\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "--module=D:\projects\task-management\frontend\node_modules\grpc\src\node\extension_binary\node-v93-win32-x64-unknown\grpc_node.node" "--module_name=grpc_node" "--module_path=D:\projects\task-management\frontend\node_modules\grpc\src\node\extension_binary\node-v93-win32-x64-unknown" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v93"     
npm ERR! gyp ERR! cwd D:projectstask-managementfrontendnode_modulesgrpc
npm ERR! gyp ERR! node -v v16.15.1
npm ERR! gyp ERR! node-gyp -v v9.0.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 'C:Program Filesnodejsnode.exe C:UsersdpoitAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gypbinnode-gyp.js configure --fallback-to-build --library=static_library --module=D:projectstask-managementfrontendnode_modulesgrpcsrcnodeextension_binarynode-v93-win32-x64-unknowngrpc_node.node --module_name=grpc_node --module_path=D:projectstask-managementfrontendnode_modulesgrpcsrcnodeextension_binarynode-v93-win32-x64-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> (D:projectstask-managementfrontendnode_modulesgrpcnode_modulesnode-pre-gyplibutilcompile.js:83:29)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
npm ERR! node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1092:16)
npm ERR! node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm ERR! node-pre-gyp ERR! System Windows_NT 10.0.19042
npm ERR! node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "D:\projects\task-management\frontend\node_modules\grpc\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
npm ERR! node-pre-gyp ERR! cwd D:projectstask-managementfrontendnode_modulesgrpc
npm ERR! node-pre-gyp ERR! node -v v16.15.1
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.12.0
npm ERR! node-pre-gyp ERR! not ok

和我的包。Json文件

{
"name": "task",
"version": "1.16.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build --vendor-chunk=true --sourceMap=false --aot --stats-json",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"go": "node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng serve --sourceMap=false"
},
"private": true,
"dependencies": {
"@agm/core": "~1.0.0",
"@agm/js-marker-clusterer": "^1.1.0",
"@angular/animations": "~7.2.0",
"@angular/cdk": "~7.3.7",
"@angular/common": "~7.2.0",
"@angular/compiler": "~7.2.0",
"@angular/core": "~7.2.0",
"@angular/fire": "^5.4.2",
"@angular/forms": "~7.2.0",
"@angular/material": "^7.3.7",
"@angular/material-moment-adapter": "^9.2.1",
"@angular/platform-browser": "~7.2.0",
"@angular/platform-browser-dynamic": "~7.2.0",
"@angular/router": "~7.2.0",
"@ks89/angular-modal-gallery": "^7.2.6",
"@mondal/org-chart": "^8.1.1",
"@ng-bootstrap/ng-bootstrap": "^4.2.2",
"@syncfusion/ej2-base": "^18.4.44",
"@types/googlemaps": "^3.43.3",
"@types/hammerjs": "^2.0.39",
"@types/mousetrap": "^1.6.8",
"@uiowa/digit-only": "^2.2.3",
"angular-progress-bar": "^1.0.11",
"angular2-qrcode": "^2.0.3",
"angularx-qrcode": "^2.2.1",
"animate.css": "^4.1.1",
"chart.js": "^2.9.4",
"ckeditor4-angular": "^1.3.0",
"core-js": "^2.5.4",
"dropzone": "^5.9.2",
"firebase": "^5.4.2",
"hammerjs": "^2.0.8",
"highcharts": "^8.2.2",
"html2canvas": "^1.0.0-rc.7",
"jquery": "^3.6.0",
"js-marker-clusterer": "^1.0.0",
"jspdf": "^2.3.1",
"mat-select-autocomplete": "^1.3.0",
"moment": "^2.24.0",
"mousetrap": "^1.6.5",
"ng-circle-progress": "^1.6.0",
"ng-http-loader": "^5.1.0",
"ng-multiselect-dropdown": "^0.3.8",
"ng-recaptcha": "^5.0.0",
"ngx-barcode": "^0.3.0",
"ngx-dropzone-wrapper": "^10.0.1",
"ngx-growl": "^1.0.3",
"ngx-image-gallery": "^2.0.5",
"ngx-image-gallery-public": "^1.5.7",
"ngx-kjua": "^1.12.3",
"ngx-mask": "^8.1.7",
"ngx-mat-select-search": "^3.3.0",
"ngx-material-timepicker": "^3.3.1",
"ngx-moment": "^3.5.0",
"ngx-owl-carousel-o": "^1.2.1",
"ngx-pagination": "^5.1.0",
"ngx-print": "^1.2.1",
"ngx-qrcode2": "^9.0.0",
"node-gyp": "^8.1.0",
"node-sass": "^4.14.1",
"print-js": "^1.6.0",
"rxjs": "~6.3.3",
"save": "^2.4.0",
"sweetalert2": "~9.11.0",
"tslib": "^1.11.1",
"xlsx": "^0.16.9",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.12.4",
"@angular/cli": "~7.3.0",
"@angular/compiler-cli": "~7.2.0",
"@angular/language-service": "~7.2.0",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "^2.0.9",
"@types/node": "~8.9.4",
"codelyzer": "~4.5.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.1.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "^5.4.3",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~3.2.2"
}
}

所以对于我来说,我尝试了许多pre-node-gyp没有成功的解决方案。我的调试日志有7k行,我决定尝试一种蛮力方法,看看是否能找到任何有问题的包——基本上是一次安装几组包。几分钟后,我找到了包(碰巧是旧的node-inspector)(. 然后我回头查看调试日志,发现如下:error node-pre-gyp ERR!试图下载(未定义):https://node-inspector.s3.amazonaws.com/profiler/v5.7.0/node-v72-win32-x64.tar.gz

只是给那些可能真的被困在这个问题上的人一个想法。

最新更新