【问题标题】:Nodejs and Coffeescript install (Ubuntu 12.04)Nodejs 和 Coffeescript 安装 (Ubuntu 12.04)
【发布时间】:2012-11-24 03:34:09
【问题描述】:

编辑:我已经添加了一个关于如何解决这个问题的答案,以防有人遇到问题。

我已将笔记本电脑从 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 build 时,它都会抛出一个错误:

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 教程安装了所有内容)。任何帮助都将不胜感激,因为我即将完成项目的一部分并且需要将其提交,但如果不编译咖啡脚本文件就无法完成。

谢谢

【问题讨论】:

  • 或者回答并接受您的回答,以防有人遇到同样的麻烦。

标签: node.js ubuntu coffeescript


【解决方案1】:

现在全部排序。我必须从包含 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

这应该可以工作

【讨论】:

    猜你喜欢
    • 2015-03-28
    • 1970-01-01
    • 1970-01-01
    • 2013-03-31
    • 1970-01-01
    • 1970-01-01
    • 2013-06-26
    • 2014-08-12
    • 2017-12-29
    相关资源
    最近更新 更多