John
John

Reputation: 1

gyp ERR! stack Error: Could not find any Visual Studio installation to use, But I'm using VSCode

I'm using VSCode and: node v16.13.2 npm 8.15.0

I just build an Angular project and install the dependencies one by one and all goes fine.

The cmd to reproduce the problem:

ng new demo-app 
# built was with routing & scss
cd demo-app
npm install primeng --save
npm install primeicons --save
npm install bootstrap --save
npm install @angular/material --save
npm install @angular/cdk --save
# now it is still fine to npm start
del /f/s/q node_modules & rmdir node_modules
npm install
# The error occurs 

While others download my project without 'node_module' folder, and trying to 'npm install' for those dependencies, it has threatened the error from node-gyp that > python is not found.

enter image description here

npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: We have news to share - Protractor is deprecated and will reach end-of-life by Summer 2023. To learn more and find out about other options please refer to this post on the Angular blog. Thank you for using and contributing to Protractor. https://goo.gle/state-of-e2e-in-angular
npm ERR! code 1
npm ERR! path C:\Users\zhoujoh\Downloads\temp\angular-demo\node_modules\fibers
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c C:\temp\install-cf48aa97.cmd
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | 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

It's strange since I didn't include anything related to python.

Then I just follow to install the python it says can't find VS or C++ something.


npm ERR! gyp ERR! find VS \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio

npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.

npm ERR! gyp ERR! find VS For more information consult the documentation at:

npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows

npm ERR! gyp ERR! find VS \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

Then I just stuck at this place.

I finally resolved this issue by skip the scripts: npm install --ignore-scripts

But should it be done for all normal projects? or I should install all those things ... python c++, VS2017 ...?
Please help if you have any ideas, thanks a lot

I'm expect how to process if I just want a normal 'npm install' for a normal project, thanks.

my package.json

{
  "name": "angular-demo",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve --port=4202 --open",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^14.2.0",
    "@angular/cdk": "^14.2.6",
    "@angular/common": "^14.2.0",
    "@angular/compiler": "^14.2.0",
    "@angular/core": "^14.2.0",
    "@angular/forms": "^14.2.0",
    "@angular/material": "^14.2.6",
    "@angular/platform-browser": "^14.2.0",
    "@angular/platform-browser-dynamic": "^14.2.0",
    "@angular/router": "^14.2.0",
    "bootstrap": "^5.2.2",
    "primeicons": "^6.0.1",
    "primeng": "^14.1.2",
    "rxjs": "~7.5.0",
    "tslib": "^2.3.0",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^14.2.2",
    "@angular/cli": "~14.2.2",
    "@angular/compiler-cli": "^14.2.0",
    "@types/jasmine": "~4.0.0",
    "jasmine-core": "~4.3.0",
    "karma": "~6.4.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "~2.2.0",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "~2.0.0",
    "typescript": "~4.7.2"
  }
}

Upvotes: 0

Views: 11710

Answers (1)

lscoughlin
lscoughlin

Reputation: 2416

something about your package thinks it needs to do a native build with gyp.

you can have the next user in the chain try:

npm install --global windows-build-tools

But you're probably better served by checking why your dependency tree thinks it needs node-gyp for an anguar project.

Upvotes: 0

Related Questions