Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

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

Ask Question 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.

npm WARN deprecated source-map-resolve@0.6.0: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: 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 request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated protractor@7.0.0: 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 node-gyp@8.4.1
npm ERR! gyp info using node@16.13.2 | 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" You probably have a native module in use like node-sass and there is no binary available for the node version that you use. In that case the module is automatically built from source, but for that, Python and a C++ development environments must exist. – CherryDT Nov 1, 2022 at 10:17 "Then I just follow to install the python" — Then you follow what? Some instructions that tell you how to compile it from source instead of just installing the pre-built version for Windows? – Quentin Nov 1, 2022 at 10:17 Then I found this doc gatsbyjs.com/docs/how-to/local-development/gatsby-on-windows , so I realized it seems a long way to go. But I think I just start a simple project. I just built the project with ng new angular-demo, install primeng, bootstrap5... as dependencies (please refer to the above). – John Nov 2, 2022 at 1:14 how to check if I used the some like 'node-sass' as my module? for 'node-sass' I did find it in my package.lock.json, but it's never been imported to my code or in the package.json – John Nov 2, 2022 at 1:46

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.

I tried to use this way but it still throwing the same error npm install --global windows-build-tools --vs2017 npm config set msvs_version 2017. – John Nov 2, 2022 at 1:03 I can install all the dependencies one by one, but can't do it with a 'npm install' >_<. I can even simulate it with delete the 'node_module' files and have a 'npm install', it's getting same problem. – John Nov 2, 2022 at 1:17

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.