首页 > 其他 > 详细

npm

时间:2016-06-25 06:10:26      阅读:259      评论:0      收藏:0      [点我收藏+]

查看版本号

npm  -v

更新npm

npm install npm –global

mac sudo npm install npm –global

删除npm uninstall forever –g

显示安装的包

npm list

查看包的信息

npm info forever

要安装什么版本@它

npm install underscore@1.6.0

安装项目开发依赖

npm install babel-cli –save-dev

安装没有安装的依赖

npm list     -------》 npm install

查看信息

npm info gulp

检查更新

npm outdated

“gulp”:”^2.0.0”

只能更新第2位

“gulp”:”~2.0.0”

只能更新第3位

“gulp”:”*”

任意更新版本

 

npm update执行更新

更换源

npm install nrm –g

nrm ls

nrm test

nrm use taobao

使用babel

babel script.js

babel script.js - -out-file script-compiled.js

babel src - -out-dir lib

babel src - -watch - -out-dir lib   停止ctrl加C

package.json

技术分享

npm run build

npm install babel-preset-es2015 - -save-dev

在项目根目录创建.babelrc

技术分享

然后重新执行

技术分享

就变成了

技术分享

 

babel-preset-react

npm install babel-preset-react - -save-dev

技术分享

重新执行

技术分享

技术分享

gulp gulp-babel

npm install gulp gulp-babel --save-dev

gulp

技术分享

npm

原文:http://www.cnblogs.com/binperson/p/5615703.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!