首页 > 开发 > NodeJS > 正文

macos上安装grunt后执行出现的问题?

2017-09-08 17:34:43  来源:网友分享

按照官网的步骤来安装的:

当创建了已经项目,项目中已经包含了gruntfile.js和packge.json等文件,当时在项目下执行grunt时候出现了下班错误提示,在node_modules中已经存在了grunt和grunt-cli

grunt-cli: The grunt command line interface. (v0.1.9)

Fatal error: Unable to find local grunt.

If you're seeing this message, either a Gruntfile wasn't found or grunt
hasn't been installed locally to your project. For more information about
installing and configuring grunt, please see the Getting Started guide

解决方案

问题已经解决,安装配置文件问题。设置为不允许全局安装方式。