CoffeeScript:安装后无输出

标签 coffeescript installation ubuntu-13.04

我运行的是 Ubuntu 13.04,安装后使用:

$ sudo npm install -g coffee-script

..带输出..

npm http GET https://registry.npmjs.org/coffee-script
npm http 304 https://registry.npmjs.org/coffee-script
/usr/local/bin/coffee -> /usr/local/lib/node_modules/coffee-script/bin/coffee
/usr/local/bin/cake -> /usr/local/lib/node_modules/coffee-script/bin/cake
<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c0a3afa6a6a5a5edb3a3b2a9b0b480f1eef6eef3" rel="noreferrer noopener nofollow">[email protected]</a> /usr/local/lib/node_modules/coffee-script

任何命令都不会产生任何结果:

$ coffee js.coffee 
$ coffee -v
$ coffee GiveMeSomeCoffeePlease

我确认它存在:

$ which coffee 
/usr/local/bin/coffee

该文件有一些内容:

$ cat `which coffee`
#!/usr/bin/env node

var path = require('path');
var fs   = require('fs');
var lib  = path.join(path.dirname(fs.realpathSync(__filename)), '../lib');

require(lib + '/coffee-script/command').run();

还尝试了可在我的笔记本电脑上运行的版本 1.6.1。不过在这台电脑上没有区别。有什么想法吗?

最佳答案

我终于找到了解决办法。我在 Ubuntu 上安装了 node 包,这是完全不同的:

Amateur Packet Radio Node program (transitional package) The existing node package has been renamed to ax25-node. This transitional package exists to ease the upgrade path for existing users.

我继续安装了 nodejs 包。但似乎它并没有完全创建正确的绑定(bind),我可以运行 nodejs 但不能运行 node。所以我为它创建了一个别名,现在 CoffeeScript 运行得很好!

cd/usr/bin; sudo ln -s nodejs 节点

关于CoffeeScript:安装后无输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20327712/

相关文章:

mongodb - 如何使用 mongoose ORM 存储/检索到 mongodb

c++ - 将 C++ 应用程序分发为 .exe 或 .msi?

linux - 新鲜蛤蜊 : symbol lookup error: freshclam: undefined symbol: print_version, 版本 FRESHCLAM_PRIVATE

java - 无法播放此视频错误

coffeescript - 使用 grunt 编译 coffeescript 文件

ruby-on-rails - 我对 "Failed to build gem native extension"感到绝望

ubuntu - 在 omnetpp 中显示菜单

postgresql - 服务器版本不匹配 postgresql pg_dump

node.js - Node CoffeeScript 类文件和继承

.net - 如何将热量输出包含在 wix 文件中? (没有 Visual Studio 项目)