P. Stepanov
P. Stepanov

Reputation: 159

Windows-build-tools installation failed

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

I try to install gemini using: npm install -g gemini

After searching about this issues i was trying to resolve 1 option for Windows in https://github.com/nodejs/node-gyp#on-windows.

And in this flow i have trouble with windows-build-tools installation. I run in cmd.exe (like Admin) : npm install --global --production windows-build-tools

Console:

C:\Windows\system32>npm install --global --production windows-build-tools

> [email protected] postinstall C:\Users\p.stepanov\AppData\Roaming\npm\node_modules\windows-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:\Users\p.stepanov\.windows-build-tools\python-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! [email protected] postinstall: `node ./lib/index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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:\Users\p.stepanov\AppData\Roaming\npm-cache\_logs\2017-10-31T07_47_09_032Z-debug.log

Already i:

Can anybody help me?

Upvotes: 10

Views: 37419

Answers (4)

Praful Shah
Praful Shah

Reputation: 11

Please make sure your running cmd with admin privileges

npm install --global --production [email protected]

Upvotes: 1

Nikita Marinosian
Nikita Marinosian

Reputation: 797

Simply running npm install --global --production [email protected] was not enough for my case. So I'd like to share the solution with the community:

  1. Install Chocolatey if it is not installed on your machine yet (choco -v to check)
  2. Go to Windows PowerShell (with Administrator rights)
  3. Execute choco install python visualcpp-build-tools -y and then npm config set msvs_version 2017
  4. Run npm install --global --production [email protected]

Now you are good to go, run npm i to install dependencies 😎

Upvotes: 6

Rohit Maurya
Rohit Maurya

Reputation: 154

Use the below command and it should work:

npm install --global --production [email protected]

Upvotes: 2

P. Stepanov
P. Stepanov

Reputation: 159

I found problem resolving in https://github.com/felixrieseberg/windows-build-tools/issues/20 :

Just add

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

Upvotes: 5

Related Questions