Tariq Roohi
Tariq Roohi

Reputation: 23

Error trying to Install Windows Build tools

When I run npm run windows-intall aka

npm install -g --production windows-build-tools && npm install --production

I get the following error. I've got python 3.8.2 installed, Node v14.0.0 x64 installed, Powershell added to path [in environment variables, User variables/System Variables, PATH]. Windows Build tools downloaded from VScommunity. I downloaded Windows dev too the universal option.(Haven't restarted PC yet)

Here is the error I got:

node ./dist/index.js

Downloading python-2.7.15.amd64.msi
[>                                            ] 0.0% (0 B/s)
Downloaded python-2.7.15.amd64.msi. Saved to C:\Users\tariq\.windows-build-tools\python- 
2.7.15.amd64.msi.
Downloading vs_BuildTools.exe
[>                                            ] 0.0% (0 B/s)
Downloaded vs_BuildTools.exe. Saved to C:\Users\tariq\.windows-build-tools\vs_BuildTools.exe.

Starting installation...
events.js:292
throw er; // Unhandled 'error' event
^

Error: spawn powershell.exe ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:268:19)
at onErrorNT (internal/child_process.js:468:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:274:12)
at onErrorNT (internal/child_process.js:468:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn powershell.exe',
  path: 'powershell.exe',
  spawnargs: [
    '-ExecutionPolicy',
    'Bypass',
    '-NoProfile',
    '-NoLogo',
    "& {& 'C:\\Users\\tariq\\AppData\\Roaming\\npm\\node_modules\\windows-build-tools\\ps1\\launch-installer.ps1' -BuildToolsInstallerPath 'C:\\Users\\tariq\\.windows-build-tools' -InstallBuildTools -ExtraBuildToolsParameters '' -PythonInstaller 'python-2.7.15.amd64.msi' -InstallPython -VisualStudioVersion '2017' }"
  ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node ./dist/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\tariq\AppData\Roaming\npm-cache\_logs\2020-06-05T04_48_32_980Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] windows-install: `npm install -g --production windows-build-tools && npm install --production`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] windows-install 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\tariq\AppData\Roaming\npm-cache\_logs\2020-06-05T04_48_33_077Z-debug.log

Upvotes: 2

Views: 4389

Answers (1)

Ahmad Altayeb
Ahmad Altayeb

Reputation: 386

Run the command-line as administrator and try this:

npm install --global [email protected]

Upvotes: 2

Related Questions