2015-05-15 36 views
1

我已經安裝了節點js 0.12以獲得和聲功能。 但是現在在我的項目開發中,我使用nvm,以便可以擁有多個節點版本。我已將默認版本設爲0.10.34。所以只要我輸入這個命令:如何從Ubuntu中刪除節點版本0.12?

node --version 

我得到版本爲0.10.34。這可以。

但是,在安裝像node-inspector這樣的一些軟件包時,下面的警告即將到來,我的調試器在安裝時無法正常工作。

engine [email protected]: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"0.12.3","npm":"2.9.1"}) 

調試器會錯誤,如:

Error: Cannot find module '/usr/lib/node_modules/node-inspector/node_modules/v8-debug/build/debug/v0.4.4/node-v11-linux-x64/debug.node' 
Runtime.getProperties failed. 
ReferenceError: frame_index is not defined 

據NPM安裝程序,版本仍然是0.12。 我搜索了很多以刪除此版本,但無法找到任何工作解決方案。

+0

您是如何安裝它的節點版本其他的方法?用'apt-get'或其他東西? – Scimonster

+0

不,它是使用捲曲請求完成的 – Kop4lyf

+0

它來自http://askubuntu.com/questions/586671/installing-latest-node-js-through-ppa-not-a-duplicate的接受答案 – Kop4lyf

回答

2

執行

sudo apt-get remove nodejs 

卸載0.12.x版本中的NodeJS。如果你的經驗和我的Ubuntu 14.04一樣,那也卸載了npm。

,你有使用curl添加的文件 /etc/apt/sources.list.d/nodesource.list

刪除文件

sudo rm /etc/apt/sources.list.d/nodesource.list 

腳本然後執行

sudo apt-get install nodejs 

它將安裝節點0.10.x.

您還需要重新創建軟鏈接,如果你打算鍵入

節點

命令行

ln -s /usr/bin/nodejs /usr/bin/node 

最後,重新安裝NPM

sudo apt-get install npm