簡體   English   中英

npm-install 命令生成 node-pre-gyp 錯誤! 構建錯誤

[英]npm-install command generate node-pre-gyp ERR! build error

我正在嘗試從舊版本運行項目。 每當我運行命令 npm 安裝時,它總是出錯。 我不知道這里發生了什么。 當我創建一個新項目時一切正常。 希望有人能幫我解決這個問題? 我是 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:\projects\task-management\frontend\node_modules\grpc
    npm ERR! command failed
    npm ERR! command C:\Windows\system32\cmd.exe /d /s /c C:\Users\dpoit\AppData\Local\Temp\install-1656322977670.cmd
    npm ERR! Failed to execute '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' (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:\projects\task-management\frontend\node_modules\grpc\src\node\extension_binary\node-v93-win32-x64-unknown\grpc_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:\Users\dpoit\AppData\Local\Programs\Python\Python39\python.exe
    npm ERR! gyp ERR! find Python - "C:\Users\dpoit\AppData\Local\Programs\Python\Python39\python.exe" could not be run
    npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python39\python.exe
    npm ERR! gyp ERR! find Python - "C:\Program Files\Python39\python.exe" could not be run
    npm ERR! gyp ERR! find Python checking if Python is C:\Users\dpoit\AppData\Local\Programs\Python\Python39-32\python.exe      
    npm ERR! gyp ERR! find Python - "C:\Users\dpoit\AppData\Local\Programs\Python\Python39-32\python.exe" could not be run       
    npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python39-32\python.exe
    npm ERR! gyp ERR! find Python - "C:\Program Files\Python39-32\python.exe" could not be run
    npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python39-32\python.exe
    npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python39-32\python.exe" could not be run
    npm ERR! gyp ERR! find Python checking if Python is C:\Users\dpoit\AppData\Local\Programs\Python\Python38\python.exe
    npm ERR! gyp ERR! find Python - "C:\Users\dpoit\AppData\Local\Programs\Python\Python38\python.exe" could not be run
    npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python38\python.exe
    npm ERR! gyp ERR! find Python - "C:\Program Files\Python38\python.exe" could not be run
    npm ERR! gyp ERR! find Python checking if Python is C:\Users\dpoit\AppData\Local\Programs\Python\Python38-32\python.exe      
    npm ERR! gyp ERR! find Python - "C:\Users\dpoit\AppData\Local\Programs\Python\Python38-32\python.exe" could not be run       
    npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python38-32\python.exe
    npm ERR! gyp ERR! find Python - "C:\Program Files\Python38-32\python.exe" could not be run
    npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python38-32\python.exe
    npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python38-32\python.exe" could not be run
    npm ERR! gyp ERR! find Python checking if Python is C:\Users\dpoit\AppData\Local\Programs\Python\Python37\python.exe
    npm ERR! gyp ERR! find Python - "C:\Users\dpoit\AppData\Local\Programs\Python\Python37\python.exe" could not be run
    npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python37\python.exe
    npm ERR! gyp ERR! find Python - "C:\Program Files\Python37\python.exe" could not be run
    npm ERR! gyp ERR! find Python checking if Python is C:\Users\dpoit\AppData\Local\Programs\Python\Python37-32\python.exe      
    npm ERR! gyp ERR! find Python - "C:\Users\dpoit\AppData\Local\Programs\Python\Python37-32\python.exe" could not be run       
    npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python37-32\python.exe
    npm ERR! gyp ERR! find Python - "C:\Program Files\Python37-32\python.exe" could not be run
    npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python37-32\python.exe
    npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python37-32\python.exe" could not be run
    npm ERR! gyp ERR! find Python checking if Python is C:\Users\dpoit\AppData\Local\Programs\Python\Python36\python.exe
    npm ERR! gyp ERR! find Python - "C:\Users\dpoit\AppData\Local\Programs\Python\Python36\python.exe" could not be run
    npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python36\python.exe
    npm ERR! gyp ERR! find Python - "C:\Program Files\Python36\python.exe" could not be run
    npm ERR! gyp ERR! find Python checking if Python is C:\Users\dpoit\AppData\Local\Programs\Python\Python36-32\python.exe      
    npm ERR! gyp ERR! find Python - "C:\Users\dpoit\AppData\Local\Programs\Python\Python36-32\python.exe" could not be run       
    npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python36-32\python.exe
    npm ERR! gyp ERR! find Python - "C:\Program Files\Python36-32\python.exe" could not be run
    npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python36-32\python.exe
    npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python36-32\python.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:\Path\To\python.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:\Path\To\python.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:\Users\dpoit\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-python.js:330:47)
    npm ERR! gyp ERR! stack     at PythonFinder.runChecks (C:\Users\dpoit\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-python.js:159:21)
    npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (C:\Users\dpoit\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-python.js:228:18)
    npm ERR! gyp ERR! stack     at PythonFinder.execFileCallback (C:\Users\dpoit\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-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:\projects\task-management\frontend\node_modules\grpc
    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 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' (1)
    npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (D:\projects\task-management\frontend\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: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:\projects\task-management\frontend\node_modules\grpc
    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

我的 package.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 行,我決定嘗試一種蠻力方法,看看我是否能找到任何有問題的包——基本上是一次安裝成組的包。 幾分鍾后,我找到了 package(恰好是舊的node-inspector )。 然后我回頭查看調試日志並發現: error node-pre-gyp ERR: Tried to download(undefined): https:// node-inspector .s3.amazonaws.com/profiler/v5.7.0/node- v72-win32-x64.tar.gz

只是對那些可能真正陷入困境的人的一個想法。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM