coffeescript安装 [英] coffeescript install

查看:288
本文介绍了coffeescript安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在我的Macbook上安装CoffeeScript。相同的命令在我的iMac上工作正常。

  $ surganov:〜surganov $ sudo npm install coffee-script -g 
npm http GET https://registry.npmjs.org/coffee-script
npm http 304 https://registry.npmjs.org/coffee-script
/ usr / local / share / npm / bin / coffee - > / usr / local / share / npm / lib / node_modules / coffee-script / bin / coffee
/ usr / local / share / npm / bin / cake - > / usr / local / share / npm / lib / node_modules / coffee-script / bin / cake
coffee-script@1.3.3 / usr / local / share / npm / lib / node_modules / coffee-script

$ surganov:〜surganov $ coffee
-bash:coffee:command not found


解决方案

我有同样的问题。当使用'-g'安装时,npm安装到/ usr / local / share / npm,所以你不能使用,例如'coffee'命令。你可以检查npm install node_modules的位置:

  npm前缀-g 
pre>

如果不是/ usr / local,那么你可以使用 npm config edit 来编辑前缀。它将在根中创建一个.npmrc文件(如果它不在)。否则,使用文本编辑器打开文件并更改前缀。更多信息: npm config


I can't install CoffeeScript on my Macbook. The same commands works just fine on my iMac.

$ surganov:~ surganov$ sudo npm install coffee-script -g
npm http GET https://registry.npmjs.org/coffee-script
npm http 304 https://registry.npmjs.org/coffee-script
/usr/local/share/npm/bin/coffee -> /usr/local/share/npm/lib/node_modules/coffee-script/bin/coffee
/usr/local/share/npm/bin/cake -> /usr/local/share/npm/lib/node_modules/coffee-script/bin/cake
coffee-script@1.3.3 /usr/local/share/npm/lib/node_modules/coffee-script

$ surganov:~ surganov$ coffee
-bash: coffee: command not found

解决方案

I had the same problem. When install with '-g', npm install to /usr/local/share/npm so you can't use, eg 'coffee' command. You can check where npm install node_modules with:

npm prefix -g

If it's not /usr/local then you can use npm config edit to edit prefix. It'll create a .npmrc file in your root (if it's not there). Otherwise, open the file with text editor and change the prefix. More info here: npm config

这篇关于coffeescript安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆