命令:(-g 表示全局安装,不然安装到当前目录下)css
npm install -g grunt-clihtml
npm install -g yonode
npm install -g bowerjquery
删除已安装:git
npm unintall -g yogithub
npm install -g generator-angularweb
mkdir testAngularajax
cd testAngularnpm
生成angular项目,eg:项目名称为“angularProject”json
yo angular angularProject
查看node项目,查看package.json文件,包含生成项目基本信息。
name为项目名称,而非所在文件夹名称,version为版本号,dependencies为项目运行须要的依赖环境,devDpendencies为项目开发所须要的依赖环境。^表示版本宽松依赖,主版本号符合便可,再执行npm install会自动更新为最近的版本。~表示最小的版本号更新。
bower是一个包管理器,能够安装须要的框架开发包,eg:jquery
bower install jquery
bower install bootstrap
若是组件比较小众,没有在bower注册,可按如下方式安装:
如图是jquery在github的短语名,假设jquery没有在bower注册,能够用如下命令安装它
bower install jquery/jquery
bower install https://github.com/jquery/jquery.git
bower instal http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
在当前文件夹下生成bower.json文件,根据bower.json文件安装所需的组件和包
bower init
bower install angular --save-dev
bower install angular --save
{ "directory":"bower_components", "proxy":"http://prox.aaa.com:8080", //代理 "https-proxy":"http://prox.aaa.com:8080", "timeout":60000 //单位毫秒 }
grunt中task,option,target的举例
compass为一个task,opitions说明具体完成什么操做。dist和server都是target,表示该task针对谁。
运行单个task,eg:tast为compass
grunt compass
只针对某个target运行单个task
grunt compass:dist
将task组合起来,一块儿运行,在Gruntfile.js中有最后的配置:
grunt build
建立package.json
npm init
npm install grunt --save-dev
npm install grunt --save
安装load-grunt-tasks插件
npm install load-grunt-tasks --save-dev
安装time-grunt插件
npm install time-grunt --save-dev
编写Gruntfile.js文件
npm install grunt-contrib-copy --save-dev 官方文件拷贝
npm install grunt-contrib-clean --save-dev 官方文件删除
Gruntfile.js文件中添加copy和clean两个target
MIT BSD ISC Apache GPL
列出端口
netstat -ano
搜索目的端口
netstat -aon|findstr "49157"
搜索目的端口对应PID指向的应用
tasklist|findstr "2720"