如何加载Visual C ++组件“VCBuild.exe”?

时间:2017-04-26 18:01:56

标签: node.js powershell windows-10

我试图运行“VCBuild.exe”

我的环境:

  • Windows 10 Pro X64

  • node v7.9.0-x64

  • Visual Studio 2017

所以,我就像这个命令一样运行。

 $npm install --global --production windows-build-tools

但它不起作用。 错误如下:

> windows-build-tools@1.2.1 postinstall C:\Users\Josephine\AppData\Roaming\npm\n       ode_modules\windows-build-tools
> node ./lib/index.js

Downloading BuildTools_Full.exe
[>                                            ] 0.0% (0 B/s)
Downloading python-2.7.11.msi
[>                                            ] 0.0% (0 B/s)
Downloaded python-2.7.11.msi. Saved to C:\Users\Josephine\.windows-build-tools\p       ython-2.7.11.msi.
Starting installation...
Please restart this script from an administrative PowerShell!
The build tools cannot be installed without administrative rights.
To fix, right-click on PowerShell and run "as Administrator".
npm WARN Error: EPERM: operation not permitted, scandir 'C:\Users\Josephine\AppD       ata\Roaming\npm\node_modules\windows-build-tools\node_modules'
npm WARN  { Error: EPERM: operation not permitted, scandir 'C:\Users\Josephine\A       ppData\Roaming\npm\node_modules\windows-build-tools\node_modules'
npm WARN   errno: -4048,
npm WARN   code: 'EPERM',
npm WARN   syscall: 'scandir',
npm WARN   path: 'C:\\Users\\Josephine\\AppData\\Roaming\\npm\\node_modules\\win       dows-build-tools\\node_modules' }
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\       node_modules\\npm\\bin\\npm-cli.js" "install" "--global" "--production" "windows       -build-tools"
npm ERR! node v7.9.0
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1

npm ERR! windows-build-tools@1.2.1 postinstall: `node ./lib/index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the windows-build-tools@1.2.1 postinstall script 'node ./lib/       index.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the windows-build-tools p       ackage,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./lib/index.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs windows-build-tools
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls windows-build-tools
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Josephine\AppData\Roaming\npm-cache\_logs\2017-04-26T17_33       _28_317Z-debug.log

我该如何修理它们?

1 个答案:

答案 0 :(得分:2)

输出正好说明了你需要做什么:

  

请从管理PowerShell重新启动此脚本!
  没有管理权限,无法安装构建工具   要解决此问题,请右键单击PowerShell并以“管理员”身份运行。

如果您以管理员身份运行PowerShell(或以前用于运行npm的命令提示符),那么它应该可以正常运行。