1. 程式人生 > 資訊 >解密百年東芝官商勾結醜聞,日本首相、特斯拉董事被捲入“漩渦”

解密百年東芝官商勾結醜聞,日本首相、特斯拉董事被捲入“漩渦”

檢視npm版本

npm -v

npm初始化專案

npm init

npm安裝模組

npm install jquery
npm install jquery@1.9.1 --save-dev

npm解除安裝模組

npm uninstall jquery 解除安裝模組,但不解除安裝模組留在package.json中的對應資訊
npm uninstall jquery -g 解除安裝全域性模組
npm uninstall jquery --save 解除安裝模組,同時解除安裝留在package.json中dependencies下的資訊
npm uninstall jquery --save-dev 解除安裝模組,同時解除安裝留在package.json中devDependencies下的資訊

npm更新模組

npm update jquery 更新最新版本的jquery
npm update jquery@2.1.0 更新到指定版本號的jquery
npm install jquery@latest 可以直接更新到最新的版本

npm檢視命令

npm root 檢視專案中模組所在的目錄
npm root -g 檢視全域性安裝的模組所在目錄
npm list 或者 npm ls 檢視本地已安裝模組的清單列表
npm view jquery dependencies 檢視某個包對於各種包的依賴關係
npm view jquery version 檢視jquery最新的版本號
npm view jquery versions 檢視所有jquery的版本號
npm view jquery 檢視最新的jquery版本的資訊
npm info jquery 檢視jquery的詳細資訊,等同於上面的npm view jquery
npm list jquery 或者 npm ls jquery 檢視本地已安裝的jquery的詳細資訊
npm view jquery repository.url 檢視jquery包的來源地址

npm其他命令

npm cache clean 清除npm的快取
npm prune 清除專案中沒有被使用的包
npm outdated 檢查模組是否已經過時
npm repo jquery 會開啟預設瀏覽器跳轉到github中jquery的頁面
npm docs jquery 會開啟預設瀏覽器跳轉到github中jquery的README.MD檔案資訊
npm home jquery 會開啟預設瀏覽器跳轉到github中jquery的主頁