Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经像这样安装了 grunt-cli npm install -g grunt-cli。然后我将 gruntfile.js 复制到我的本地项目文件夹中。我尝试运行grunt命令,但出现无法找到本地安装的 grunt 的错误。grunt然后我像这样安装npm install grunt --save-dev并且它起作用了。所以我的问题是我是否需要同时安装grunt-cliand grunt?
npm install -g grunt-cli
grunt
npm install grunt --save-dev
grunt-cli
是的。您需要在您的 package.json 和计算机上的 grunt-cli(全局)上发出 grunt。