Ошибка с node-gyp во время установки npm в Windows 10

Я получаю следующую ошибку с node-gyp, когда я выполняю установку npm в Windows 10 с помощью GitBash. Я попытался снова переустановить node-gyp, но не помогает. Кто-нибудь знает, как решить эту проблему?

$ npm install
npm WARN package.json [email protected] No description
npm WARN package.json [email protected] No README data

> [email protected] install C:\Users\Jason\Desktop\Projects\brainiac\node_modules\js2xml\node_modules\libxmljs
> node-gyp rebuild


C:\Users\Jason\Desktop\Projects\brainiac\node_modules\js2xml\node_modules\libxmljs>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
TRACKER : error TRK0005: Failed to locate: "CL.exe". The system cannot find the file specified. [C:\Users\Jason\Desktop\Projects\brainiac\node_modules\js2xml\node_modules\libxmljs\build\vendor\libxml\libxml.vcxproj]


gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Jason\Desktop\Projects\brainiac\node_modules\js2xml\node_modules\libxmljs
gyp ERR! node -v v4.4.3
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.4.3
npm ERR! npm  v2.15.1
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the libxmljs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs libxmljs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR!     npm owner ls libxmljs
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Jason\Desktop\Projects\brainiac\npm-debug.log

person jashuang1130    schedule 22.08.2016    source источник
comment
Я думаю, это связано с невозможностью найти вашу визуальную студию cl.exe для компиляции. Я должен настоятельно предложить использовать windows-build-tools, если вы этого не сделаете. Инструкции по установке можно найти в readme узла-gyp. Это автоматически установит все инструменты, необходимые для создания собственных модулей в Windows.   -  person dvlsg    schedule 22.08.2016
comment
Вам также может потребоваться обновить npm, как показано здесь (Во всяком случае, мне пришлось это сделать на моей машине с Windows 10).   -  person dvlsg    schedule 22.08.2016
comment
Я попытался установить последнюю версию npm и инструменты сборки Windows, но все еще не исправил ошибку.   -  person jashuang1130    schedule 22.08.2016


Ответы (1)


Если вы установили Visual Studio 2015/другой полный пакет и получили такую ​​ошибку, может помочь запустить установку npm из «Командной строки собственных инструментов VS2015 x64» или сначала вызвать «C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC \vcvarsall.bat"

person Evalds Urtans    schedule 19.03.2017