从git checkout构buildyeoman项目
从git构buildyeoman项目结账时遇到问题。 我试图把yeoman项目的git checkout和运行grunt服务 。 以下是错误描述的情况
场景描述:
Person1使用yoangular度创build了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
我需要帮助完成从git checkout构build项目的任务,所以我可以继续开发。
在App-Directory中执行一个简单的npm install
。
问题是:Yeoman-Projcet有很多npm依赖,不仅是自己的咕噜声,而且还有所有的咕噜声任务和生成器。 但是,当然,你不需要你的仓库中的所有包。 这就是“package.json”文件:它列出项目依赖的所有包。 npm install
读取package.json并自行安装所有需要的软件包。
要正确运行应用程序,还需要执行bower install
。 Bower是前端程序包npm用于节点的。 “bower install”会在“bower.json”中查找依赖包,并将其安装。
分两步解决。 以下命令:
- npm安装
- 凉亭安装
现在运行grunt服务
$ grunt serve Running "serve" task Running "clean:server" (clean) task Running "bower-install:app" (bower-install) task Running "concurrent:server" (concurrent) task Running "compass:server" (compass) task directory .tmp/styles/ create .tmp/styles/main.css (8.454s) Compilation took 8.455s Done, without errors. Execution Time (2014-03-13 10:53:01 UTC) compass:server 9.1s ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 100% Total 9.1s Running "autoprefixer:dist" (autoprefixer) task Prefixed file ".tmp/styles/main.css" created. Running "connect:livereload" (connect) task Started connect web server on 127.0.0.1:9000. Running "watch" task Waiting...
这解决了这个问题。
让我知道如果这可以避免或以更好的方式完成:)
- 如何在angular度/节点应用程序中正确发送和接收表单数据
- XMLHttpRequest无法加载http://127.0.0.1:1337/。 请求的资源上没有“Access-Control-Allow-Origin”标题
- 套接字在服务器端代码节点内发射
- 当我使用AngularJS和Node.JS上传文件时,“NetworkError:404 Not Found”
- 避免JavaScript前端和Java后端的validation码重复?
- 使用Socket IO在Node JS进程完成时发出消息
- 如何结合快递和angular度路线
- fs.writefile只能在节点js的最后一个函数中执行
- 如何在Html的下拉菜单中访问匹配的数据?