installation - Grunt 已安装但无法正常工作 - Mavericks 上的 "Command not found"

标签 installation gruntjs osx-mavericks

我正在尝试将 grunt 与 sass 结合使用,并且一直在遵循以下指南:

  • http://gruntjs.com/getting-started
  • http://benfrain.com/lightning-fast-sass-compiling-with-libsass-node-sass-and-grunt-sass/
  • http://www.hongkiat.com/blog/grunt-command-not-found/

  • 我已经:
  • 安装 node.js
  • 安装命令行版 grunt:sudo npm install -g grunt -cli
  • 将 grunt 安装程序的路径添加到我的 bash 配置文件中:export PATH=/usr/local/lib/node_modules/grunt/bin:$PATH
  • 使配置文件成为可执行文件:source ~/.bash_profile
  • 设置 package.jsonGruntfile.js我的项目根目录中的文件
  • 将 grunt 安装到项目中:cd /path/to/project/root/sudo npm install

  • 但是当我尝试运行时 grunt我看到:command not found
    如果我运行也一样:grunt --version
    根据上面发布的博客,我不确定 bash 路径是否需要/bin 最后,但已经尝试了两种方式:/usr/local/lib/node_modules/grunt//usr/local/lib/node_modules/grunt/bin/
    我也多次运行 grunt 安装程序,但没有看到任何错误,所以我肯定它已经安装了 - 谁能看到我做错了什么?我正在运行 OSX 小牛,以防这是问题所在。

    任何指向正确方向的指针将不胜感激。

    干杯

    最佳答案

    你的命令有错别字。该包名为 grunt-cli没有空间。

    将命令更新为:

    sudo npm install -g grunt-cli
    

    一切都应该按预期工作。

    关于installation - Grunt 已安装但无法正常工作 - Mavericks 上的 "Command not found",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21016771/

    相关文章:

    java - 如何在linux(centos 6.4)中安装tomcat?

    javascript - Grunt 任务在执行时不创建 dist 文件夹

    node.js - Grunt.js : Fire livereload as soon a files are modified, 任务完成前

    javascript - 一个 grunt 插件如何包装另一个插件

    elasticsearch - 在 OSX Mavericks 上安装 Elasticsearch

    macos - Applescript "do shell script with administrator privileges"在后台挂起

    c# - 为性能计数器安装 Total 实例

    installation - 使用 "DownloadString"参数调用 "1"的异常 : "Unable to connect to the remote server"

    python - 将 ScientificPython 安装为依赖项

    python - 在 OS X 上安装 Pycurl 时出错