我有一個詹金斯構建失敗,出現以下錯誤:爲什麼coffeescript需要全局安裝?
+ npm install
npm WARN prefer global [email protected] should be installed with -g
好奇,爲什麼咖啡腳本,或任何包裝對於這個問題,需要在全球範圍內安裝?
我有一個詹金斯構建失敗,出現以下錯誤:爲什麼coffeescript需要全局安裝?
+ npm install
npm WARN prefer global [email protected] should be installed with -g
好奇,爲什麼咖啡腳本,或任何包裝對於這個問題,需要在全球範圍內安裝?
因爲coffeescript
是一個命令行工具,可以將coffeescript轉換爲javascript,或者像node
類似的交互式shell運行。
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