nodejs custom environment configuration global system

gulp Strapping Tools
Can compress and optimize the resources of the project js / css / html / images and other documents of the testing, inspection, consolidation, compression, formatting, browser automatically refresh, the deployment file generation, and listen to repeatedly specify the file after these changes step.


npm root -g view npm install a global catalog on the inside
E:\nodejs\node_global\node_modules


Modified to a convenient directory
E:\nodejs\node_global\node_modules



1. In the new installation path NodeJS two folders and node_cache node_global
npm config set prefix "E:\nodejs\node_global"

npm config set prefix "C:\Program Files\nodejs\node_global"

npm config set cache "E:\nodejs\node_cache"

npm config set cache "C:\Program Files\nodejs\node_cache"




First, create the "system variables" in the variable named NODE_PATH, the variable value: absolute file path node_modules new global module used to store files in the folder in the folder. (User tells the system to download a global module here).

NODE_PATH:E:\nodejs\node_global\node_modules

C:\Program Files\nodejs\node_global


PATH : %NODE_PATH%;E:\nodejs\node_global;

%NODE_PATH%;C:\Program Files\nodejs\node_global;


%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;E:\nodejs\;E:\wamp\mysql\bin;%NODE_PATH%;E:\nodejs\node_global;E:\git\Git\cmd;E:\svn-server\bin;E:\svn-client\bin;%NODE_PATH%;E:\nodejs\node_global;


npm root -g and then test to see whether a global catalog npm have successfully modified



Global internal mounting installation project

Global installed directly into the global directory is set nodejs

Internal installation project: just mounted to the inside of the project and generate node_modules in the current folder of the project in



1, the global installed
cnpm install gulp -g

Detecting whether the installation is successful
gulp --version

All subsequent operations are carried out under the project directory
New package.json file (package file)
cnpm init

Local installation gulp plug

cnpm install gulp --save
cnpm install [email protected] --save specified version

--save be added to the package information Installation Dependencies (dependent production phase)
--save-dev be added to the installation package information devDependencies (dependent on the development stage)


New gulpfile.js file
gulpfile.js is gulp project profile, ordinary js file located in the root directory of the project


Installation gulp plugins to optimize project

gulp-imagemin Image Compression
cnpm install gulp-imagemin --save


cnpm install gulp-minify-css --save compression plug-css
cnpm install gulp-uglify --save compression js
cnpm install gulp-concat --save js合并
cnpm install gulp-autoprefixer --save 浏览器前缀
cnpm install gulp-rev-append --save 给页面添加版本号


bower 360软件管理


安装
cnpm install bower -g

设置下载目录
.bowerrc 文件

{
"directory" : "assets/plugin"
}

bower初始化 项目目录里面执行
bower init


查找 bootstrap
bower search bootstrap


查看包的信息
bower info bootstrap

包安装
bower install bootstrap --save


包更新
bower update

包的卸载
bower uninstall bootstrap

Guess you like

Origin www.cnblogs.com/Zcyou/p/11299601.html