node.js - Installationen af ​​Windows-build-tools mislykkedes

Indlæg af Hanne Mølgaard Plasc

Problem



Windows 10, Node - 8.8.1, NPM - 5.4.2, Node-gyp - 3.6.2


Jeg forsøger at installere gemini ved hjælp af: npm installer -g gemini


Efter at have søgt om disse problemer forsøgte jeg at løse 1 mulighed for Windows i https://github.com/nodejs/node-gyp#on-windows.[3]


Og i dette flow har jeg problemer med installation af Windows-build-tools.
Jeg kører i cmd.exe (som Admin): npm install - global --produktion windows-build-tools


konsol:


C:Windowssystem32>npm install --global --production windows-build-tools

> windows-build-tools@1.3.2 postinstall C:Usersp.stepanovAppDataRoaming
pm
ode\_moduleswindows-build-tools
> node ./lib/index.js

Downloading BuildTools\_Full.exe
Downloading python-2.7.13.msi
[>                                            ] 0.0\% (0 B/s)
Downloaded python-2.7.13.msi. Saved to C:Usersp.stepanov.windows-build-toolspython-2.7.13.msi.
Starting installation...
events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: spawn powershell.exe ENOENT
    at \_errnoException (util.js:1024:11)
    at Process.ChildProcess.\_handle.onexit (internal/child\_process.js:192:19)
    at onErrorNT (internal/child\_process.js:374:16)
    at \_combinedTickCallback (internal/process/next\_tick.js:138:11)
    at process.\_tickCallback (internal/process/next\_tick.js:180:9)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! windows-build-tools@1.3.2 postinstall: `node ./lib/index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the windows-build-tools@1.3.2 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:Usersp.stepanovAppDataRoaming
pm-cache\_logs2017-10-31T07\_47\_09\_032Z-debug.log


Allerede jeg:



  • Tilføj miljøvariablen VCTargetsPath øverste punkt på C ++
    build tools path

  • Prøv 2 valg fra https://github.com/nodejs/node-gyp#on-windows



Kan nogen hjælpe mig? [4]

Bedste reference


Jeg fandt problemløsning på https://github.com/felixrieseberg/windows-build-tools/issues/20: [5]


Just add

\%SystemRoot\%/system32/WindowsPowerShell/v1.0
to your PATH and you should be good to go