編集:誰かが苦労した場合に備えて、これを修正する方法に関する回答を追加しました。
ラップトップを 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 変数に問題があると思います (このチュートリアルに従ってすべてをインストールしました)。私はプロジェクトの一部を完成させようとしており、それを提出する必要がありますが、coffeescript ファイルをコンパイルしないとそれを行うことができないため、どんな助けも本当に感謝しています。
ありがとう