nodejs提示

來源:互聯網
上載者:User

標籤:lob   vue2   nvm   ted   user   tty   enc   連接埠   oba   

1.nvm,nodejs版本管理工具,可以自由切換nodejs版本

https://github.com/coreybutler/nvm-windows/releases

在這裡下載安裝。

使用命令:

nvm ls 查看所有可用nodejs版本

nvm use x.x.x 使用x.x.x版本

nvm install x.x.x安裝x.x.x版本

2.nrm,nodejs源切換工具,可以自由切換nodejs下載源

npm install nrm -g 全域安裝nrm

nrm ls 查看可用的npm源

nrm test 測試每個源的速度,可以選擇數值最小的源使用,國內一般是cnpm

nrm use xx 使用xx源

3.nodejs升級、重裝等出現Cannot find module ‘xxx‘,假設目前使用者名Lenovo,找到C:\Users\Lenovo\AppData\Roaming下的npm、npm-cache檔案夾刪除,重新安裝即可。

4.常用命令:

npm -v 查看npm版本
npm install xxx -g 全域安裝xxx模組
npm list --depth=0 -global 查看全域安裝的模組列表

npm install xxx --save 安裝xxx模組並放到package.json 的dependencies,作為生產依賴

npm install --save-dev 安裝xxx模組並放到package.json 的devDependencies,作為開發依賴

5.vue2腳手架提示:Error: listen EADDRINUSE :::8080,這是8080連接埠被佔用了,解決方案:

netstat  -aon|findstr "8080" 找出哪個進程佔用了8080連接埠

taskkill /pid xxx -F 殺死這個pid為xxx的進程


 

 



 
 

nodejs提示

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.