-
全局安装
grunt cli
工具:npm install -g grunt-cli
如提示有权限问题则使用:
sudo npm install -g grunt-cli
-
确认安装成功并查看
grunt
版本:grunt --version
-
如其它项目使用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
文件删除(如果有的话)再次安装
npm安装Grunt后却找不到命令
最新推荐文章于 2022-03-05 14:52:46 发布