未找到 Coffee 脚本命令

未找到 Coffee 脚本命令

我第一次尝试使用咖啡脚本,这样我就可以修改 Harvest 的 Chosen 插件。我使用了npm install -d他们指定的命令GitHub 页面安装蛋糕和咖啡。

这是我在终端中安装后得到的响应。看起来还不错。

    Chriss-MacBook-Pro:chosen chrispaynter$ npm install -d
    npm info it worked if it ends with ok
    npm info using [email protected]
    npm info using [email protected]
    npm info preinstall [email protected]
    npm info trying registry request attempt 1 at 17:43:15
    npm http GET https://registry.npmjs.org/uglify-js
    npm info trying registry request attempt 1 at 17:43:15
    npm http GET https://registry.npmjs.org/coffee-script
    npm http 304 https://registry.npmjs.org/coffee-script
    npm http 200 https://registry.npmjs.org/uglify-js
    npm info retry fetch attempt 1 at 17:43:20
    npm http GET https://registry.npmjs.org/uglify-js/-/uglify-js-2.2.1.tgz
    npm http 200 https://registry.npmjs.org/uglify-js/-/uglify-js-2.2.1.tgz
    npm info shasum c47e5f0ac40ea8cd951584d7cb08251085a02ea0
    npm info shasum /var/folders/js/8hvbp5wn7112m6q2vrtvc0fw0000gn/T/npm-22190/1354776200898-0.665826462674886/tmp.tgz
    npm info shasum 999ddf992af8f21d597621e5745c1b0a365cab6b
    npm info shasum /Users/chrispaynter/.npm/uglify-js/2.2.1/package.tgz
    npm info install [email protected] into /Users/chrispaynter/GitHub/chosen
    npm info install [email protected] into /Users/chrispaynter/GitHub/chosen
    npm info installOne [email protected]
    npm info installOne [email protected]
    npm info /Users/chrispaynter/GitHub/chosen/node_modules/coffee-script unbuild
    npm info /Users/chrispaynter/GitHub/chosen/node_modules/uglify-js unbuild
    npm info preinstall [email protected]
    npm info build /Users/chrispaynter/GitHub/chosen/node_modules/coffee-script
    npm info linkStuff [email protected]
    npm info install [email protected]
    npm info postinstall [email protected]
    npm info preinstall [email protected]
    npm info trying registry request attempt 1 at 17:43:23
    npm http GET https://registry.npmjs.org/source-map
    npm info trying registry request attempt 1 at 17:43:23
    npm http GET https://registry.npmjs.org/optimist
    npm http 200 https://registry.npmjs.org/optimist
    npm info retry fetch attempt 1 at 17:43:27
    npm http GET https://registry.npmjs.org/optimist/-/optimist-0.3.5.tgz
    npm http 200 https://registry.npmjs.org/source-map
    npm info retry fetch attempt 1 at 17:43:27
    npm http GET https://registry.npmjs.org/source-map/-/source-map-0.1.8.tgz
    npm http 200 https://registry.npmjs.org/optimist/-/optimist-0.3.5.tgz
    npm info shasum 03654b52417030312d109f39b159825b60309304
    npm info shasum /var/folders/js/8hvbp5wn7112m6q2vrtvc0fw0000gn/T/npm-22190/1354776207590-0.29829918104223907/tmp.tgz
    npm http 200 https://registry.npmjs.org/source-map/-/source-map-0.1.8.tgz
    npm info shasum 706b69dbcda9485c412444c953536af3c84e5715
    npm info shasum /Users/chrispaynter/.npm/optimist/0.3.5/package.tgz
    npm info shasum 0bcc088a50ed8c586f50c8da4833a27dc0cc0c30
    npm info shasum /var/folders/js/8hvbp5wn7112m6q2vrtvc0fw0000gn/T/npm-22190/1354776207907-0.6172509784810245/tmp.tgz
    npm info shasum 0bcc088a50ed8c586f50c8da4833a27dc0cc0c30
    npm info shasum /Users/chrispaynter/.npm/source-map/0.1.8/package.tgz
    npm info install [email protected] into /Users/chrispaynter/GitHub/chosen/node_modules/uglify-js
    npm info install [email protected] into /Users/chrispaynter/GitHub/chosen/node_modules/uglify-js
    npm info installOne [email protected]
npm info installOne [email protected]
npm info /Users/chrispaynter/GitHub/chosen/node_modules/uglify-js/node_modules/optimist unbuild
npm info /Users/chrispaynter/GitHub/chosen/node_modules/uglify-js/node_modules/source-map unbuild
npm info preinstall [email protected]
npm info trying registry request attempt 1 at 17:43:30
npm http GET https://registry.npmjs.org/wordwrap
npm info preinstall [email protected]
npm info trying registry request attempt 1 at 17:43:30
npm http GET https://registry.npmjs.org/amdefine
npm http 200 https://registry.npmjs.org/wordwrap
npm info retry fetch attempt 1 at 17:43:32
npm http GET https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz
npm http 200 https://registry.npmjs.org/amdefine
npm info retry fetch attempt 1 at 17:43:32
npm http GET https://registry.npmjs.org/amdefine/-/amdefine-0.0.4.tgz
npm http 200 https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz
npm http 200 https://registry.npmjs.org/amdefine/-/amdefine-0.0.4.tgz
npm info shasum b79669bb42ecb409f83d583cad52ca17eaa1643f
npm info shasum /var/folders/js/8hvbp5wn7112m6q2vrtvc0fw0000gn/T/npm-22190/1354776212399-0.16841556527651846/tmp.tgz
npm info shasum 510e24a0f231314e1105b9c747e79aaed694a0e9
npm info shasum /var/folders/js/8hvbp5wn7112m6q2vrtvc0fw0000gn/T/npm-22190/1354776212409-0.4660297026857734/tmp.tgz
npm info shasum 128b5f2b33fcb64adc31d9a0ba13df6fc6c397c2
npm info shasum /Users/chrispaynter/.npm/wordwrap/0.0.2/package.tgz
npm info install [email protected] into /Users/chrispaynter/GitHub/chosen/node_modules/uglify-js/node_modules/optimist
npm info installOne [email protected]
npm info /Users/chrispaynter/GitHub/chosen/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap unbuild
npm info shasum f4148643494a8ba95fbc3af06b6af48346b9aedb
npm info shasum /Users/chrispaynter/.npm/amdefine/0.0.4/package.tgz
npm info install [email protected] into /Users/chrispaynter/GitHub/chosen/node_modules/uglify-js/node_modules/source-map
npm info installOne [email protected]
npm info /Users/chrispaynter/GitHub/chosen/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine unbuild
npm info preinstall [email protected]
npm info build /Users/chrispaynter/GitHub/chosen/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine
npm info linkStuff [email protected]
npm info install [email protected]
npm info postinstall [email protected]
npm info build /Users/chrispaynter/GitHub/chosen/node_modules/uglify-js/node_modules/source-map
npm info linkStuff [email protected]
npm info install [email protected]
npm info postinstall [email protected]
npm info preinstall [email protected]
npm info build /Users/chrispaynter/GitHub/chosen/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap
npm info linkStuff [email protected]
npm info install [email protected]
npm info postinstall [email protected]
npm info build /Users/chrispaynter/GitHub/chosen/node_modules/uglify-js/node_modules/optimist
npm info linkStuff [email protected]
npm info install [email protected]
npm info postinstall [email protected]
npm info build /Users/chrispaynter/GitHub/chosen/node_modules/uglify-js
npm info linkStuff [email protected]
npm info install [email protected]
npm info postinstall [email protected]
npm info build /Users/chrispaynter/GitHub/chosen
npm info linkStuff [email protected]
npm info install [email protected]
npm info postinstall [email protected]
[email protected] node_modules/coffee-script


[email protected] node_modules/uglify-js
├── [email protected] ([email protected])
└── [email protected] ([email protected])
npm info ok 

但是,我无法让 coffee 工作。当我尝试访问变量时,我总是收到命令未找到错误。

Chriss-MacBook-Pro:chosen chrispaynter$ coffee
-bash: coffee: command not found

我之前尝试过通过安装,npm install -g coffee-script但安装后出现同样的错误。有人知道这是怎么回事吗?

答案1

您需要全局安装 coffee-script:

npm install coffee-script -g

答案2

对于 Windows,搜索coffee.cmd并将该路径添加到您的path环境变量中。它应该是这样的/Users/chrispaynter/GitHub/chosen/node_modules/.bin

在 Mac 上尝试一下。http://www.tech-recipes.com/rx/2621/os_x_change_path_environment_variable/

相关内容