简体   繁体   中英

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

I am trying to run project from older version. whenever I run command npm install, it always get error. I have no idea what is happening here. Everything works well when I create a new project. Hoping someone can help me to resolve this problem? i am new to nodejs. i was trying to install nodejs as per documentation. while using npm install command to install dependencies, i faced an error.

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

and my package.json file is

{
  "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"
  }
}

So for me, I tried many of the pre-node-gyp solutions with no success. My debug log had 7k lines and I decided to try a brute force approach to see if I could find any offending packages - basically installing groups of packages at a time. Within a few minutes I found the package (happened to be old node-inspector ). I then looked back into the debug-log and found this: 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

Just a thought for those that may get really stuck on this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM