【问题标题】:npm nodejs vue/cli problem can't run 'vue ui'npm nodejs vue/cli 问题无法运行'vue ui'
【发布时间】:2022-01-25 15:28:30
【问题描述】:

我只是想在一台新的 Win10pro 机器上安装 Vue 的工具链,结果卡住了几次,出现不同的错误。但是,它们看起来都具有相同的根本原因。

当我运行vue ui 时出现以下错误:

    @vue/cli 4.5.15
PS C:\Users\ralph\AppData\Roaming\npm> vue ui
????  Starting GUI...
????  Ready on http://localhost:8000
node:events:368
      throw er; // Unhandled 'error' event
      ^

Error: spawn cmd ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
    at onErrorNT (node:internal/child_process:477:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (node:internal/child_process:288:12)
    at onErrorNT (node:internal/child_process:477:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn cmd',
  path: 'cmd',
  spawnargs: [ '/c', 'start', '""', '/b', 'http://localhost:8000' ]
}

我已将 Windows 的运行脚本策略设置为

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine

我知道这允许本地机器上的任何脚本都可以运行。

我发现使用官方安装程序 msi 安装的 nodejs 安装时出现这些警告很可疑

PS C:\Users\ralph\AppData\Roaming\npm> npm i -g @vue/cli
npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated apollo-tracing@0.15.0: The `apollo-tracing` package is no longer part of Apollo Server 3. See https://www.apollographql.com/docs/apollo-server/migration/#tracing for details
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated graphql-extensions@0.15.0: The `graphql-extensions` API has been removed from Apollo Server 3. Use the plugin API instead: https://www.apollographql.com/docs/apollo-server/integrations/plugins/
npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
npm WARN deprecated apollo-cache-control@0.14.0: The functionality provided by the `apollo-cache-control` package is built in to `apollo-server-core` starting with Apollo Server 3. See https://www.apollographql.com/docs/apollo-server/migration/#cachecontrol for details.
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.
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.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'
npm WARN deprecated graphql-tools@4.0.8: This package has been deprecated and now it only exports makeExecutableSchema.\nAnd it will no longer receive updates.\nWe recommend you to migrate to scoped packages such as @graphql-tools/schema, @graphql-tools/utils and etc.\nCheck out https://www.graphql-tools.com to learn what package you should use instead

added 941 packages, and audited 942 packages in 2m

67 packages are looking for funding
  run `npm fund` for details

11 vulnerabilities (4 moderate, 7 high)

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.

有什么建议吗?我已经重新安装了 5 次,并遵循了我能找到的所有其他建议。

祝你好运

【问题讨论】:

  • 尝试检查 8000 端口是否已经在操作系统中忙碌。
  • errno代码-4058表示文件访问有问题根本不是端口问题,但感谢您的关注

标签: node.js vue.js npm


【解决方案1】:

我找到了根本原因,最后很简单。 \system32 的全局路径丢失

【讨论】:

  • 正如目前所写,您的答案尚不清楚。请edit 添加其他详细信息,以帮助其他人了解这如何解决所提出的问题。你可以找到更多关于如何写好答案的信息in the help center
猜你喜欢
  • 1970-01-01
  • 2021-06-20
  • 2020-10-27
  • 2020-06-03
  • 2020-10-31
  • 2017-11-11
  • 2018-07-13
  • 2020-07-21
  • 2019-12-17
相关资源
最近更新 更多