npm (Node Package Manager) is a package manager for Node.js It allows developers to create, share, and reuse modules in Node.js application. It can also be used to share complete Node.js applications. Modules are simply libraries of code that can be reused in different projects.
npm 是Node.js 的模組依賴管理工具。作為開發者使用的工具,主要解決開發Node.js 時會遇到的問題。
npm的常用命令
参考:http://www.cnblogs.com/xiziyin/archive/2012/01/21/2328473.html
[url=http://hi.baidu.com/alimyself/item/3ba5200faba0c7c92f4c6b43]http://hi.baidu.com/alimyself/item/3ba5200faba0c7c92f4c6b43[/url]
npm install xxx 安裝模組
npm install xxx@1.1.1 安裝1.1.1版本的xxx
npm install xxx -g 將模組安裝到全域環境中。
npm ls 查看安裝的模組及依賴
npm ls -g 查看全域安裝的模組及依賴
npm uninstall xxx (-g) 卸載模組
npm cache clean 清理緩存
npm help xxx 查看幫助
npm view moudleName dependencies 查看包的依賴關係
npm view moduleNames 查看node模組的package.json資料夾
npm view moduleName labelName 查看package.json資料夾下某個標籤的內容
npm view moduleName repository.url 查看包的原始檔案地址
npm view moduleName engines 查看包所依賴的Node的版本
npm help folders 查看npm使用的所有資料夾
npm rebuild moduleName 用於更改包內容後進行重建
npm outdated 檢查包是否已經過時,此命令會列出所有已經過時的包,可以及時進行包的更新
npm update moduleName 更新node模組
- Oct 20 Mon 2014 03:55
[Node.js] What is npm(Node Package Manager)
close
全站熱搜
留言列表
發表留言