node.js安裝

來源:互聯網
上載者:User

標籤:c   style   blog   a   http   color   

1.地址:http://nodejs.org/download/ 進入後按不同的作業系統下載相應的安裝包

2.下載後運行即可。

  可在命令列輸入 node -v 和 npm -v

  查看是否安裝成功

  

3.npm(Node包管理器)安裝,更新,卸載包

  

(1)全域模式下載,進入命令列模式輸入:

    npm install -g <package name>

    安裝完成後,會提示包安裝在了哪以及其它相關資訊。

     可修改npm的全域模組的存放路徑以及cache的路徑

     在命令列中輸入

        npm config set prefix "f:\test" 和 npm config set cache "f:\node_cache"

     輸入 npm config ls -l 可以查看當前的目錄設定,可以通過 npm config set 屬性名稱 屬性值的方式來進行其他配置

 (2)本地模式下載,進入命令列模式輸入:

    npm install <package name>

   存放的路徑為你進入的目前的目錄

 安裝命令可以是

    npm install <package name>@<version spec>

  選擇安裝的包的版本,如

    npm install [email protected]

    npm install [email protected]  0.2的最新版

    npm install [email protected]"<0.3" 小於0.3的最新版

    npm install =0.1.0<0.3.1‘>[email protected]">=0.1.0<0.3.1" 等

  

  

  

 

  卸載包

    npm uninstall <package name>

  更新包

    npm update <package name>

  全域操作加入-g標誌

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.