簡體   English   中英

無法在Ubuntu 12.04上安裝帶有coffeescript的node.js

[英]Can't install node.js with coffeescript on Ubuntu 12.04

試圖用類似的CoffeeScript安裝的node.js

sudo sudo apt-get install nodejs npm
sudo npm install -g coffee-script

但:

coffee -v

返回我:

Error: require.paths is removed. Use node_modules folders, or the NODE_PATH environment variable instead.
    at Function.Object.defineProperty.get (module.js:388:11)
    at Object.<anonymous> (/home/lapsa/bin/coffee@1.3.0:4:21)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:903:3

我現在完全迷路了。 有什么幫助嗎?


嘗試這種方法沒有成功。

$ npm -v
1.2.15

$ node -v
v0.11.0-pre

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.2 LTS
Release:        12.04
Codename:       precise

這個解決方案對我有用(在Ubuntu 12.04和13.04上都經過測試):

sudo apt-get install python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
sudo npm install -g coffee-script

來源: https : //github.com/joyent/node/wiki/Installing-Node.js-via-package-manager

請注意,它不使用默認的Ubuntu軟件包npm 相反, npm與Chris Lea的nodejs軟件包nodejs打包。

如果您已經安裝了npm ,則在應用上述解決方法之前,可能需要先將其刪除。 請注意,與名為node的軟件包也存在命名沖突,但與nodejs無關。 如果您意外安裝了該軟件包,則可能還需要將其刪除。

我想知道您的問題是否與嘗試使用安裝npm有關

sudo apt-get install nodejs npm

如果您查看通過軟件包管理器安裝nodejs的說明,則會指出:

As of Node.js v0.10.0, the nodejs package from Chris Lea's repo includes both npm and nodejs-dev.

我想知道npm軟件包的惡意安裝版本是否會導致您出現問題。 前幾天我遇到了這個問題,但對我來說,npm根本無法安裝。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM