2017-04-09 115 views

回答

1

因爲coffeescript是一個命令行工具,可以將coffeescript轉換爲javascript,或者像node類似的交互式shell運行。

NPMJS docs

There are two ways to install npm packages: locally or globally. You choose which kind of installation to use based on how you want to use the package.

If you want to use it as a command line tool, something like the grunt CLI, then you want to install it globally. On the other hand, if you want to depend on the package from your own module using something like Node's require, then you want to install locally.

這在技術上是可能的本地安裝這些CLI包,但隨後你將不得不使用相對路徑來運行它們如(未經測試):

./node_modules/coffeescript/bin/coffeescript 
相關問題