Nodejs和Coffeescript安装(Ubuntu 12.04)

时间:2012-05-09 12:24:57

标签: node.js ubuntu coffeescript

编辑:我已经添加了一个如何解决此问题的答案,以防有人与之斗争。

我已将笔记本电脑从Ubuntu 11升级到12.04,由于某种原因,coffeescript编译器停止工作。我用它进行Web开发,但我仍然是一个在linux环境中工作的新手。

基本上当我尝试运行cake.coffeescript时,我得到以下内容:

path.existsSync is deprecated. It is now called `fs.existsSync`.
Cakefile defines the following tasks:

cake doc                  # generate documentation for *.coffee files
cake doc_copy             # copy documentation to gh-pages branch
cake build                # generate unified JavaScript file for whole Hallo
cake min                  # minify the generated JavaScript file
cake bam                  # build and minify Hallo

所以从某种意义上说它有效,但每当我尝试运行cake.coffeescript构建时,它都会抛出一个错误:

path.existsSync is deprecated. It is now called `fs.existsSync`.
Executing coffee -o examples -j hallo.js -c `find src -type f -name '*.coffee'`
{ [Error: Command failed: 
node.js:249
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: require.paths is removed. Use node_modules folders, or the NODE_PATH environment variable instead.
    at Function.<anonymous> (module.js:381:11)
    at Object.<anonymous> (/home/ignas/bin/coffee@1.3.1:4:21)
    at Module._compile (module.js:444:26)
    at Object..js (module.js:462:10)
    at Module.load (module.js:351:32)
    at Function._load (module.js:309:12)
    at module.js:482:10
    at EventEmitter._tickCallback (node.js:238:11)
] killed: false, code: 1, signal: null }

node.js:249
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: require.paths is removed. Use node_modules folders, or the NODE_PATH environment variable instead.
    at Function.<anonymous> (module.js:381:11)
    at Object.<anonymous> (/home/ignas/bin/coffee@1.3.1:4:21)
    at Module._compile (module.js:444:26)
    at Object..js (module.js:462:10)
    at Module.load (module.js:351:32)
    at Function._load (module.js:309:12)
    at module.js:482:10
    at EventEmitter._tickCallback (node.js:238:11)

我猜这是由nodejs引起的。我试图谷歌寻求解决方案,但没有任何帮助。我认为问题在于我已经包含在〜/ .bashrc文件顶部的NODE_PATH变量(我跟着this教程安装了所有内容)。任何帮助都会非常感激,因为我即将完成项目的一部分并需要交付,但如果不编译coffeescript文件就无法完成。

由于

1 个答案:

答案 0 :(得分:8)

现在全部排序。我必须删除所有现有文件夹以及包含npm,coffee-script和节点的ubuntu存储库中的所有内容,并从git安装所有内容。 一步一步安装:

1. clone https://github.com/joyent/node.git
2. git checkout v0.6.17 //current stable at my time
3. cd node && ./configure && make && make install
4. curl http://npmjs.org/install.sh | sudo sh
5. download coffeescript from git and do sudo bin/cake install
6. sudo npm install coffee-script -g

这应该有效