Unable to install Grunt ?
我安装了Grunt:
1 2 3 4 | sudo npm install -g grunt-cli /Users/user/.nvm/versions/node/v4.3.0/bin/grunt -> /Users/user/.nvm/versions/node/v4.3.0/lib/node_modules/grunt-cli/bin/grunt /Users/user/.nvm/versions/node/v4.3.0/lib └── [email protected] |
但当我运行grunt时,我有错误:
1 2 3 4 5 6 7 8 9 10 | grunt grunt-cli: The grunt command line interface (v1.2.0) 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: http://gruntjs.com/getting-started |
请问我哪里错了?
您必须在全局和本地安装grunt
您已使用-g标志全局安装了CLI
现在您必须在package.json中本地安装它…
1 | npm install -SD grunt |
那么您的"grunt"命令就可以工作了——假设您有一个有效的gruntfile
这看起来像是致命错误的副本:找不到本地呼噜声。
简而言之,首先尝试运行