Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error install windows-build-tools #20

Open
facelinker opened this issue Aug 19, 2016 · 15 comments

Comments

@facelinker
Copy link

commented Aug 19, 2016

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

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

... and 1 more

... and 1 more
Downloaded python-2.7.11.msi. Saved to C:\Users\Alexander.windows-build-tools\p
ython-2.7.11.msi.
Starting installation...
events.js:160
throw er; // Unhandled 'error' event
^

Error: spawn powershell.exe ENOENT
at exports._errnoException (util.js:1007:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:182:32)
at onErrorNT (internal/child_process.js:348:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
npm ERR! Windows_NT 6.3.9600
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 v6.2.2
npm ERR! npm v3.9.5
npm ERR! code ELIFECYCLE

npm ERR! windows-build-tools@0.4.1 postinstall: node ./lib/index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the windows-build-tools@0.4.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:\Windows\system32\npm-debug.log

@felixrieseberg

This comment has been minimized.

Copy link
Owner

commented Aug 19, 2016

Hey @facelinker, I can see from the logs that the script failed to run PowerShell. Which version of Windows are you running? Are you attempting the installation from PowerShell?

@DcBexter

This comment has been minimized.

Copy link

commented Aug 30, 2016

Same problem here...
image

I'm trying to run the installation from an elevated powershell prompt in Windows 7.

Here is the npm-debug.log from the point where the script tries to execute the postinstall tasks:

15161 info lifecycle windows-build-tools@0.6.0~postinstall: windows-build-tools@0.6.0
15162 verbose lifecycle windows-build-tools@0.6.0~postinstall: unsafe-perm in lifecycle true
15163 verbose lifecycle windows-build-tools@0.6.0~postinstall: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;C:\Users\Milan\AppData\Roaming\npm\node_modules\windows-build-tools\node_modules.bin;C:\Users\Milan\AppData\Roaming\npm\node_modules.bin;C:\Program Files\nodejs;%SystemRoot%\system32\WindowsPowerShell\v1.0\;C:\Python27\;C:\Python27\Scripts;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;c:\Program Files (x86)\CA\SC\Csam\SockAdapter\bin;C:\cygwin\bin;D:\Workspace\Android\SDK\platform-tools;C:\Program Files (x86)\GnuWin32\bin;D:\Programme\Vagrant\bin;D:\Workspace\xampp-5.6.3\php;C:\ProgramData\ComposerSetup\bin;C:\cygwin64\bin;C:\Program Files\TortoiseGit\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Oracle\VirtualBox;D:\dev_box\maven\bin;C:\Program Files\nodejs\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Users\Milan\AppData\Roaming\npm
15164 verbose lifecycle windows-build-tools@0.6.0~postinstall: CWD: C:\Users\Milan\AppData\Roaming\npm\node_modules\windows-build-tools
15165 silly lifecycle windows-build-tools@0.6.0~postinstall: Args: [ '/d /s /c', 'node ./lib/index.js' ]
15166 silly lifecycle windows-build-tools@0.6.0~postinstall: Returned: code: 1  signal: null
15167 info lifecycle windows-build-tools@0.6.0~postinstall: Failed to exec postinstall script
15168 verbose unlock done using C:\Users\Milan\AppData\Roaming\npm-cache_locks\staging-8a451d69396f2b17.lock for C:\Users\Milan\AppData\Roaming\npm\node_modules.staging
15169 silly rollbackFailedOptional Starting
15170 silly rollbackFailedOptional Finishing
15171 silly runTopLevelLifecycles Starting
15172 silly runTopLevelLifecycles Finishing
15173 silly install printInstalled
15174 verbose stack Error: windows-build-tools@0.6.0 postinstall: `node ./lib/index.js`
15174 verbose stack Exit status 1
15174 verbose stack     at EventEmitter.<anonymous(C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:242:16)
15174 verbose stack     at emitTwo (events.js:106:13)
15174 verbose stack     at EventEmitter.emit (events.js:191:7)
15174 verbose stack     at ChildProcess.<anonymous(C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
15174 verbose stack     at emitTwo (events.js:106:13)
15174 verbose stack     at ChildProcess.emit (events.js:191:7)
15174 verbose stack     at maybeClose (internal/child_process.js:852:16)
15174 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
15175 verbose pkgid windows-build-tools@0.6.0
15176 verbose cwd C:\Users\Milan
15177 error Windows_NT 6.1.7601
15178 error argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "-g" "--production" "windows-build-tools"
15179 error node v6.4.0
15180 error npm  v3.10.3
15181 error code ELIFECYCLE
15182 error windows-build-tools@0.6.0 postinstall: `node ./lib/index.js`
15182 error Exit status 1
15183 error Failed at the windows-build-tools@0.6.0 postinstall script 'node ./lib/index.js'.
15183 error Make sure you have the latest version of node.js and npm installed.
15183 error If you do, this is most likely a problem with the windows-build-tools package,
15183 error not with npm itself.
15183 error Tell the author that this fails on your system:
15183 error     node ./lib/index.js
15183 error You can get information on how to open an issue for this project with:
15183 error     npm bugs windows-build-tools
15183 error Or if that isn't available, you can get their info via:
15183 error     npm owner ls windows-build-tools
15183 error There is likely additional logging output above.
15184 verbose exit [ 1, true ]```

@DcBexter

This comment has been minimized.

Copy link

commented Aug 30, 2016

Found a solution while writing the post above...

Just add

%SystemRoot%/system32/WindowsPowerShell/v1.0

to your PATH and you should be good to go

@srflaxu40

This comment has been minimized.

Copy link

commented Nov 22, 2017

If on Jenkins / windows slaves reverse the slashes if you're setting the slave's PATH variable through the ENVIRONMENT feature in node configuration.

@razorsharpshady

This comment has been minimized.

Copy link

commented Nov 28, 2017

run cmd as administrator after doing what DcBexter told above,
and then run your command.

@jacobq

This comment has been minimized.

Copy link
Collaborator

commented Jan 31, 2018

Note also that you should use the system PATH not your user's PATH since it will be running as Administrator.

@felixrieseberg, how hard would it be to output a more meaningful error message for cases where the script can't find/run PowerShell? If I hadn't found this thread I might still be stuck. There wasn't anything in the log about PowerShell, so it wasn't obvious to me. What if it output another line here saying something like, "Could not run PowerShell (Is it in the system's PATH?)"

3891 verbose unlock done using C:\Users\Jacob\AppData\Roaming\npm-cache\_locks\staging-dfd8fbf9c1feea0f.lock for C:\Program Files\nodejs\node_modules\.staging
3892 verbose stack Error: windows-build-tools@1.4.0 postinstall: `node ./lib/index.js`
3892 verbose stack Exit status 1
3892 verbose stack     at EventEmitter.<anonymous> (C:\Users\Jacob\AppData\Roaming\nvm\v8.9.4\node_modules\npm\node_modules\npm-lifecycle\index.js:285:16)
3892 verbose stack     at emitTwo (events.js:126:13)
3892 verbose stack     at EventEmitter.emit (events.js:214:7)
3892 verbose stack     at ChildProcess.<anonymous> (C:\Users\Jacob\AppData\Roaming\nvm\v8.9.4\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
3892 verbose stack     at emitTwo (events.js:126:13)
3892 verbose stack     at ChildProcess.emit (events.js:214:7)
3892 verbose stack     at maybeClose (internal/child_process.js:925:16)
3892 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
3893 verbose pkgid windows-build-tools@1.4.0
3894 verbose cwd C:\Users\Jacob
3895 verbose Windows_NT 10.0.16299
3896 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--global" "windows-build-tools"
3897 verbose node v8.9.4
3898 verbose npm  v5.6.0
3899 error code ELIFECYCLE
3900 error errno 1
3901 error windows-build-tools@1.4.0 postinstall: `node ./lib/index.js`
3901 error Exit status 1
3902 error Failed at the windows-build-tools@1.4.0 postinstall script.
3902 error This is probably not a problem with npm. There is likely additional logging output above.
3903 verbose exit [ 1, true ]
@resnef

This comment has been minimized.

Copy link

commented Feb 22, 2018

@DcBexter Hi sir, how can i do the adding of %SystemRoot%/system32/WindowsPowerShell/v1.0 to my path? Is it on the CMD? I tried adding but it says The system cannot find the path specified.

It's embarrassing, but i don't get the instruction well.

By the way, my project path is c:\xampp\htdocs\ifsumis... is this the path to add to %SystemRoot%/system32/WindowsPowerShell/v1.0?

@DcBexter

This comment has been minimized.

Copy link

commented Mar 17, 2018

@resnef Hi, the Path is an environment variable which you can set in "advanced system settings" (Control Panel -> System -> Advanced System Settings -> Environment Variables / Or press "Windows key" + "Pause key" -> Advanced System Settings -> Environment Variables )

It is possible to set the path on the commandline (cmd.exe) with

setx path "%path%;%SystemRoot%/system32/WindowsPowerShell/v1.0"

Which would add %SystemRoot%/system32/WindowsPowerShell/v1.0 To the path of your current user.

If you want to change the path system-wide for all users, you have to start cmd.exe as an administrator and use the /M Parameter:

setx /M "%path%;%SystemRoot%/system32/WindowsPowerShell/v1.0"

If you use powershell instead of cmd.exe you have to use this:

setx /M "$env:path;%SystemRoot%/system32/WindowsPowerShell/v1.0"

@jsurya9311

This comment has been minimized.

Copy link

commented Mar 24, 2018

@DcBexter Hi,

After making the changes to PATH variable as mentioned, i ran the command

npm install --global --production windows-build-tool

But it's for running the command is running for a long time.
Python was installed, but Windows build tools is taking time.

Its 15 mins & is still running.
Should i be worried??

+Update--Installed successfully after running for around 30 mins.

Thanks for the help @DcBexter & All.

@nahidarashid

This comment has been minimized.

Copy link

commented Apr 25, 2018

Hi, i am getting this, and i tried adding values to the path variable:
npm install --global --production windows-build-tools > windows-build-tools@2.3.0 postinstall C:\Users\Nahida\AppData\Roaming\npm\node_modules\windows-build-tools > node ./lib/index.js C:\Users\Nahida\AppData\Roaming\npm\node_modules\windows-build-tools\node_modules\in-gfw\lib\os.js:53 throw resultError; ^ Error: Exited with status null at closeArgsToError (C:\Users\Nahida\AppData\Roaming\npm\node_modules\windows-build-tools\node_modules\in-gfw\lib\geo.js:5:15) at spawnSync (C:\Users\Nahida\AppData\Roaming\npm\node_modules\windows-build-tools\node_modules\in-gfw\lib\geo.js:62:16) at regQuery (C:\Users\Nahida\AppData\Roaming\npm\node_modules\windows-build-tools\node_modules\in-gfw\lib\geo.js:83:3) at getNation (C:\Users\Nahida\AppData\Roaming\npm\node_modules\windows-build-tools\node_modules\in-gfw\lib\geo.js:93:3) at Object.geo [as sync] (C:\Users\Nahida\AppData\Roaming\npm\node_modules\windows-build-tools\node_modules\in-gfw\lib\geo.js:105:3) at Object.osSync (C:\Users\Nahida\AppData\Roaming\npm\node_modules\windows-build-tools\node_modules\in-gfw\lib\os.js:48:7) at Object. (C:\Users\Nahida\AppData\Roaming\npm\node_modules\windows-build-tools\lib\constants.js:4:99) at Module._compile (internal/modules/cjs/loader.js:654:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10) at Module.load (internal/modules/cjs/loader.js:566:32) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! windows-build-tools@2.3.0 postinstall: node ./lib/index.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the windows-build-tools@2.3.0 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\Nahida\AppData\Roaming\npm-cache_logs\2018-04-25T05_43_38_023Z-debug.log

@jacobq

This comment has been minimized.

Copy link
Collaborator

commented Apr 25, 2018

@nahidarashid Could you please edit your message so that the console output is formatted such that it is easier to read? (e.g. currently there are no newlines, so it just looks like a "wall of text")

@jacobq

This comment has been minimized.

Copy link
Collaborator

commented Apr 30, 2018

@nahidarashid Your problem may also be caused by a geolocation problem. Feel free to check out #110 and try setting the environment variable to work around the problem as I suggsted to TikiLobel.

@Rahanmohan1

This comment has been minimized.

Copy link

commented Oct 24, 2018

@DcBexter Hi,

After making the changes to PATH variable as mentioned, i ran the command

npm install --global --production windows-build-tool

But it's for running the command is running for a long time.
Python was installed, but Windows build tools is taking time.

Its 15 mins & is still running.
Should i be worried??

+Update--Installed successfully after running for around 30 mins.

Thanks for the help @DcBexter & All.

Hi jsurya9311, please contact me about development 7010482701

@suyash796

This comment has been minimized.

Copy link

commented Jan 11, 2019

Pls check this and tell how to fix this ?

victorbutler/binance-profit-calculator#22 (comment)

@kevin950

This comment has been minimized.

Copy link

commented Jul 31, 2019

Windows PowerShell (Mouse right click - Administrator),
write here
install --global --production windows-build-tools
will be successfully install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.