search

Home  >  Q&A  >  body text

前端 - 全局安装了grunt,仍然提示,grunt不是内部或外部命令

用命令npm install -g grunt-cli npm install -g grunt安装grunt后
运行命令 grunt -v或者grunt 一直提示‘grunt’不是内部或外部命令,也不是可运行的程序...


这是我的环境变量配置

大家讲道理大家讲道理2744 days ago622

reply all(3)I'll reply

  • 習慣沉默

    習慣沉默2017-05-15 16:57:43

    Cannot be installed globally grunt 值要安装 grunt-cli就可以了,然后在 %AppData%Roamingnpm 会生成一个 grunt.cmdIt means the installation is successful.

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-05-15 16:57:43

    Guess: pathThe semicolon in the path won’t be a Chinese semicolon, right?

    reply
    0
  • PHP中文网

    PHP中文网2017-05-15 16:57:43

    Open

    C:\Users(用户)\你的用户名\.npmrc 

    Change this file
    to

    prefix=C:\Program Files\nodejs\node_modules
    cache=C:\Program Files\nodejs\node_cache
    registry = http://registry.cnpmjs.org

    The first two are the two folders under the node installation path

    reply
    0
  • Cancelreply