簡體   English   中英

咕嚕聲找不到羅盤命令。 為什么不?

[英]grunt cannot find compass command. Why not?

我正在嘗試使用grunt和yeoman在CentOS 7上設置node.js服務器,但是我收到一條錯誤,指出無法找到compass命令。 我讀了另一篇關於類似錯誤的帖子,但另一篇帖子假設你在rails上使用ruby,我不是。 此外, 我正在測試的方法來自本教程 ,當我在教程中指出鍵入grunt serve.時,事情就會停止工作grunt serve. 我已經為教程做了一些補充,逐一解決錯誤消息,但是關於指南針的當前錯誤似乎沒有google-able的答案。

我需要采取哪些具體步驟才能使咕嚕聲能夠找到並使用指南針?

以下是導致grunt serve失敗的當前錯誤:

Warning: Running "compass:server" (compass) task
Warning: Command failed: /bin/sh -c compass --version
/bin/sh: compass: command not found
 Use --force to continue.
Aborted due to warnings.

以下是導致此問題的一系列命令:

首先,我以root身份執行了以下安裝命令:

yum install -y nodejs
yum clean all && yum update
yum install -y gcc-c++ openssl-devel make
npm install -g express
npm install -g express-generator
npm install -g yo
npm install -g generator-angular
npm install -g bower
npm install -g nodemon
npm install -g grunt-cli  
npm install generator-karma 
npm install -g compass 
npm install -g grunt-contrib-compass  

接下來,我切換到非root用戶帳戶並運行以下命令:

cd /home/user/angular_apps 
mkdir /home/user/angular_apps/my_new_project && cd /home/user/angular_apps/my_new_project
mkdir /home/user/angular_apps/my_new_project/client  // will house angular and app code
mkdir /home/user/angular_apps/my_new_project/server  // will house node and express code, among other things
cd /home/user/angular_apps/my_new_project/client
yo angular  // get yeoman to scaffold out the front end
    // yeoman asked many questions.  I said no to replacing grunt with anything else and I said yes to every other include  
npm install // this will install all the required packages
bower install // this will hook up bower and thus prevent a downstream error
grunt serve 

grunt serve命令導致以下完整錯誤輸出:

[user@localhost client]$ grunt serve
Running "serve" task
Running "clean:server" (clean) task
>> 0 paths cleaned.
Running "wiredep:app" (wiredep) task
Running "wiredep:test" (wiredep) task
Running "wiredep:sass" (wiredep) task
Running "concurrent:server" (concurrent) task
    Warning: Running "compass:server" (compass) task
    Warning: Command failed: /bin/sh -c compass --version
    /bin/sh: compass: command not found
     Use --force to continue.
    Aborted due to warnings.

    Execution Time (2016-02-15 23:22:25 UTC)
    loading tasks                  254ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 76%
    loading grunt-contrib-compass   28ms  ▇▇▇ 8%
    compass:server                  50ms  ▇▇▇▇▇ 15%
    Total 333ms Use --force to continue.

    Aborted due to warnings.

Execution Time (2016-02-15 23:22:24 UTC)
loading tasks             307ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 20%
wiredep:app               254ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 17%
wiredep:sass               37ms  ▇▇▇ 2%
loading grunt-concurrent   23ms  ▇▇ 2%
concurrent:server         865ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 57%
Total 1.5s
[user@localhost client]$ 

請注意,當我嘗試以root身份運行grunt serve時,會返回相同的錯誤消息。 那么需要采取哪些具體步驟來解決此錯誤?

我認為指南針是紅寶石的東西。

嘗試gem install compass

對於基於百勝的系統

yum -y install gcc ruby-devel rubygems compass也可以。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM