欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

bash: grunt: command not found 有大用

npm安装Grunt后却找不到命令

  1. 全局安装grunt cli工具:

    npm install -g grunt-cli
    

    如提示有权限问题则使用:

    sudo npm install -g grunt-cli
  2. 确认安装成功并查看grunt版本:

    grunt --version
  3. 如其它项目使用grunt命令时提示找不到grunt命令,如下提示

    λ grunt -v
    grunt-cli: The grunt command line interface (v1.3.2)
    
    Fatal error: Unable to find local grunt.
    
    If you're seeing this message, grunt hasn't been installed locally to
    your project. For more information about installing and configuring grunt,
    please see the Getting Started guide:
    
    https://gruntjs.com/getting-started
    

    则可以使用

    npm install grunt --save-dev
    

    或者直接

    npm install
    

    安装项目中package.json指定的grunt版本。
    再或者将当前项目package-lock.json文件删除(如果有的话)再次安装


来自    https://blog.csdn.net/alt_tab_jj/article/details/86156606

普通分类: