如何加载可视化C++组件"VCBuild.exe"?



我试图运行"VCBuild.exe">

我的环境:

  • 视窗 10 专业版 X64

  • 节点 v7.9.0-x64

  • Visual Studio 2017

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

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

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

> windows-build-tools@1.2.1 postinstall C:UsersJosephineAppDataRoamingnpmn       ode_moduleswindows-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:UsersJosephine.windows-build-toolsp       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:UsersJosephineAppD       ataRoamingnpmnode_moduleswindows-build-toolsnode_modules'
npm WARN  { Error: EPERM: operation not permitted, scandir 'C:UsersJosephineA       ppDataRoamingnpmnode_moduleswindows-build-toolsnode_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:UsersJosephineAppDataRoamingnpm-cache_logs2017-04-26T17_33       _28_317Z-debug.log

我该如何修复它们?

输出准确地说明了您需要执行的操作:

请从管理 PowerShell 重新启动此脚本!
如果没有管理权限,则无法安装生成工具。
要修复,请右键单击PowerShell并"以管理员身份"运行。

如果以管理员身份运行 PowerShell(或用于运行npm的命令提示符),则它应该可以工作。

最新更新