大佬教程收集整理的这篇文章主要介绍了node.js – 从git checkout构建yeoman项目,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
场景描述:
Person1使用yo angular创建了yeoman angularjs项目. grunt serve在Person1的计算机上工作正常. Person1将代码推送到git,以便其他团队成员可以使用它.
当Person2结帐git时会出现问题(git clone< URL>).签出副本中的grunt serve命令将给出以下错误:
$grunt serve grunt-cli: The grunt command linE interface. (v0.1.13) 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: http://gruntjs.com/getTing-started
我试过了:npm install grunt
我收到以下错误:
grunt serve Loading "Gruntfile.js" tasks...ERROR >> Error: CAnnot find module 'load-grunt-tasks' Warning: Task "serve" not found. Use --force to conTinue. Aborted due to warnings.
使用的工具 :
$grunt -version grunt-cli v0.1.13 grunt v0.4.4 $yo -v 1.1.2 suraj@localhost:tesTing$npm -version 1.4.4
ls -l在目录上
drwxrwxr-x app -rw-rw-r-- bower.json -rw-rw-r-- Gruntfile.js -rw-rw-r-- karma.conf.js -rw-rw-r-- karma-e2e.conf.js drwxrwxr-x node_modules -rw-rw-r-- package.json drwxrwxr-x test
问题是:
Yeoman-ProjCET有很多npm依赖,不仅是grunt本身,还有所有grunts任务和生成器.但是,当然你不希望你的存储库中的所有这些包.这就是“package.json”文件的来源:它列出了项目所依赖的所有包. npm install读取package.json并自行安装所有需要的包.
要正确运行应用程序,您还需要执行bower安装.bower用于Frontend-Packages,npm用于节点. “bower install”在“bower.json”-File中查找依赖包并安装它们.
以上是大佬教程为你收集整理的node.js – 从git checkout构建yeoman项目全部内容,希望文章能够帮你解决node.js – 从git checkout构建yeoman项目所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。