【问题标题】:Vue Cli error when using npm "npm install -g @vue/cli"使用 npm "npm install -g @vue/cli" 时出现 Vue Cli 错误
【发布时间】:2020-11-01 02:49:29
【问题描述】:

我正在使用:

  • Windows 10
  • node.js 12
  • npm 6

在 cmd 中运行以下命令安装 Vue Cli:

npm install -g @vue/cli

我遇到了这个问题:

C:\Windows\System32>vue --version
'vue' n’est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.

C:\Windows\System32>npm install -g @vue/cli
npm ERR! Unexpected end of JSON input while parsing near '..."^3.12.1","istanbul":'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\KHALED\AppData\Roaming\npm-cache\_logs\2020-07-11T13_22_34_143Z-debug.log

【问题讨论】:

  • 你能发布你的package.json吗?看起来您的 package.json 不是有效的 json。
  • 尝试来自this answer的步骤

标签: node.js vue.js npm


【解决方案1】:

尝试以相同的顺序使用这些命令-

      npm install vue
      npm cache clean --force
      npm install -g @vue/cli

如果这不起作用,请尝试使用 VPN 并重新安装 Node

【讨论】:

    猜你喜欢
    • 2019-12-17
    • 2021-02-13
    • 2021-02-13
    • 2021-08-25
    • 2018-09-01
    • 1970-01-01
    • 2018-05-22
    • 1970-01-01
    • 2019-03-29
    相关资源
    最近更新 更多