vue serve命令问题

来源:4-2 单页面应用Demo1

qq_超级马里奥_0

2019-01-16 15:51

vue ui等等执行都是正常,vue-cli是全局安装的

但是执行vue serve的时候提示

 Command vue serve requires a global addon to be installed.

  Please run npm install -g @vue/cli-service-global and try again.

写回答 关注

3回答

  • Brian
    2019-01-16 17:25:41

    Command vue serve requires a global addon to be installed.

      Please run npm install -g @vue/cli-service-global and try again.

    你的报错的这两句话直译过来就是 “vue serve命令需要全局安装,请使用npm install -g @vue/cli-service-global”

    如果以上的命令执行后还是不行,请检查 :

    1. 检查npm, node版本。

    2. 给node命令执行的cmd终端“超级管理员权限”。

    3. 重新安装cli命令工具:npm install -g @vue/cli , 使用vue serve命令还需要安装:npm install -g @vue/cli-service-global

    4. 检查 cli版本。

    5. 重新运行vue serve

  • qq_超级马里奥_0
    2019-01-16 16:06:15

    在root权限下也可以查看vue版本

  • qq_超级马里奥_0
    2019-01-16 15:56:45

    执行npm安装语句会报错

    npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.

    npm ERR! Unexpected end of JSON input while parsing near '...endencies":{"@webasse'


    npm ERR! A complete log of this run can be found in:

    npm ERR!     /var/root/.npm/_logs/2019-01-16T07_55_56_672Z-debug.log


    栗子歪010...

    我也出现了这个问题,请问你是怎么解决的呢

    2019-09-10 10:21:05

    共 1 条回复 >

3小时速成 Vue2.x 核心技术

带你快速学习最流行的前端框架vue2.x的核心技术

82558 学习 · 487 问题

查看课程

相似问题