我有一个工作的 yeoman 项目,我用 grunt server
运行服务器,它工作正常。
我把整个东西放到一个 git 仓库中,然后将它 checkout 到一个新文件夹中...
当我尝试执行“grunt 服务器”时,它说:
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.
我无法将 grunt 安装到该目录本地,也无法找到和使用 GruntFile。
最佳答案
checkout Yeoman 项目后,您需要像在初始脚手架过程之后那样安装 npm 模块和 bower 组件,因为它们不是 git 存储库的一部分:
npm install & bower install
关于git - 让 grunt.js 在一个预先存在的 yeoman 项目上工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15146960/