Home > Back-end >  Can't install windows build tools
Can't install windows build tools

Time:07-19

While I was reading a part of a book about discord.js, it made me install windows build tools with “npm install --global --production --vs2015 --add-python-to-path windows-build-tools”. But when I tried, it failed and showed this:

npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm WARN config production Use `--omit=dev` instead.
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]: Node.js now includes build tools for Windows. You probably no longer need this tool. See https://github.com/felixrieseberg/windows-build-tools for details.
npm ERR! code 1
npm ERR! path C:\Users\andye\AppData\Roaming\npm\node_modules\windows-build-tools
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node ./dist/index.js
Downloading python-2.7.15.amd64.msi
npm ERR! [============================================>] 100.0% of 20.2 MB (6.23 MB/s)
npm ERR! Downloaded python-2.7.15.amd64.msi. Saved to C:\Users\andye\.windows-build-tools\python-2.7.15.amd64.msi.
Downloading BuildTools_Full.exe
npm ERR! [============================================>] 100.0% of 3.29 MB (3.29 MB/s)
npm ERR! Downloaded BuildTools_Full.exe. Saved to C:\Users\andye\.windows-build-tools\BuildTools_Full.exe.
npm ERR!
npm ERR! Starting installation...
npm ERR! Please restart this script from an administrative PowerShell!
npm ERR! The build tools cannot be installed without administrative rights.
npm ERR! To fix, right-click on PowerShell and run "as Administrator".

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\andye\AppData\Local\npm-cache\_logs\2022-07-18T03_25_51_844Z-debug-0.log

I don't know how to fix it, I am just a rookie.

CodePudding user response:

The message clearly states:

Please restart this script from an administrative PowerShell!

Press Windows key, type "powershell", right click on "Windows PowerShell" and client "Run As Administrator", then try again.

  • Related