使用npm install --global --production windows-build-tools命令安装过程中出现了npm error的情况怎么办,求大佬解答

来源:-

慕仔1103974

2021-10-14 15:35

npm WARN deprecated windows-build-tools@5.2.2: Node.js now includes build tools for Windows. You probably no longer need this tool. See https://github.com/felixrieseberg/windows-build-tools for details.

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

npm WARN deprecated har-validator@5.1.5: this library is no longer supported

npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.


> windows-build-tools@5.2.2 postinstall C:\Users\pc\AppData\Roaming\npm\node_modules\windows-build-tools

> 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\pc\.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\pc\.windows-build-tools\vs_BuildTools.exe.


Starting installation...

events.js:377

      throw er; // Unhandled 'error' event

      ^


Error: spawn powershell.exe ENOENT

    at Process.ChildProcess._handle.onexit (internal/child_process.js:274:19)

    at onErrorNT (internal/child_process.js:469:16)

    at processTicksAndRejections (internal/process/task_queues.js:82:21)

Emitted 'error' event on ChildProcess instance at:

    at Process.ChildProcess._handle.onexit (internal/child_process.js:280:12)

    at onErrorNT (internal/child_process.js:469:16)

    at processTicksAndRejections (internal/process/task_queues.js:82:21) {

  errno: -4058,

  code: 'ENOENT',

  syscall: 'spawn powershell.exe',

  path: 'powershell.exe',

  spawnargs: [

    '-ExecutionPolicy',

    'Bypass',

    '-NoProfile',

    '-NoLogo',

    "& {& 'C:\\Users\\pc\\AppData\\Roaming\\npm\\node_modules\\windows-build-tools\\ps1\\launch-installer.ps1' -BuildToolsInstallerPath 'C:\\Users\\pc\\.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! windows-build-tools@5.2.2 postinstall: `node ./dist/index.js`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the windows-build-tools@5.2.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:\Users\pc\AppData\Roaming\npm-cache\_logs\2021-10-14T07_31_00_618Z-debug.log

写回答 关注

0回答

还没有人回答问题,可以看看其他问题

Tensorflow.js 实现垃圾分类

应用Tensorflow.js,3小时带你搞定一个垃圾分类 App。

3908 学习 · 16 问题

查看课程

相似问题