node.js 警告:运行“compass:server”(指南针)任务

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/30995951/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 18:54:25  来源:igfitidea点击:

Warning: Running "compass:server" (compass) task

angularjsnode.jsgruntjsyo

提问by

D:\Projects\mallspk>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: 'compass.bat' is not recognized as an internal or exter
nal command,
    operable program or batch file.
     Use --force to continue.

I have install the Yo angularand runs the followings commands:

我已经安装Yo angular并运行以下命令:

npm install grunt --save-dev
npm install -g grunt-contrib-compass 
npm install -g compass
npm install
bower install
npm install  grunt-google-cdn

and when i run the command grunt servei have got this error. i have latest node and npm install with latest grunt and yo.

当我运行命令时,grunt serve我收到了这个错误。我有最新的节点和 npm 安装最新的 grunt 和哟。

回答by

I had ruby install @squiroid. I forget to run gem install compass. That worked for me.

我有红宝石安装@squiroid。我忘记跑了gem install compass。那对我有用。

回答by Gujarat Santana

I've the same problem in ubuntu and I did this to solve my problem :

我在 ubuntu 中遇到了同样的问题,我这样做是为了解决我的问题:

  1. sudo apt-get install ruby
  2. sudo apt-get install ruby-compass
  3. sudo gem install compass
  1. sudo apt-get install ruby
  2. sudo apt-get install ruby-compass
  3. sudo gem install compass

after that grunt serveworks

在那之后grunt serve工作

回答by squiroid

I had the same problem I installed compass gem on my desktop and it is resolved.

我在桌面上安装了指南针 gem 时遇到了同样的问题,但已解决。

If you're on OS X or Linux you probably already have Ruby installed; test with ruby -v in your terminal. When you've confirmed you have Ruby installed, run gem update --system && gem install compass to install Compass and Sass.

如果您使用的是 OS X 或 Linux,您可能已经安装了 Ruby;在终端中使用 ruby​​ -v 进行测试。确认安装了 Ruby 后,运行 gem update --system && gem install compass 来安装 Compass 和 Sass。

For windows you can download rubyand then install compass.

对于 Windows,您可以下载ruby,然后安装指南针。

Hope it helps :)

希望能帮助到你 :)

回答by Mbuso Mkhize

I searched and searched ... until finally I got the answer to this problem.
In my case it happened when I was creating a new angularjs application with yeomen.

我找了又找……直到最后我得到了这个问题的答案。
就我而言,它发生在我使用 yeomen 创建新的 angularjs 应用程序时。

This answer is specific to windows users

此答案特定于 Windows 用户

Step 1: Install ruby http://rubyinstaller.org/downloads/

第 1 步:安装 ruby http://rubyinstaller.org/downloads/

Step 2 : download rubygems Link : https://rubygems.org/rubygems/rubygems-2.6.8.zip

第 2 步:下载 ruby​​gems 链接:https://rubygems.org/rubygems/rubygems-2.6.8.zip

Step 3 : unzip rubygems-2.6.8.zip

第三步:解压rubygems-2.6.8.zip

Step 4 : open powershell (terminal/command line) to the rubygems-2.6.8 folder path.(location of the folder eg. c:\folder\folder)

第 4 步:打开 powershell(终端/命令行)到 ruby​​gems-2.6.8 文件夹路径。(文件夹的位置,例如 c:\folder\folder)

Step 5 : in the powershell terminal run these commands

第 5 步:在 powershell 终端中运行这些命令

> ruby setup.rb

> gem install compass

enjoy!

请享用!

回答by andyCao

I had the same problem

我有同样的问题

"yo angular" with sass option will use the compass, which is a ruby gem.

带有 sass 选项的“yo angular”将使用指南针,这是一个红宝石。

Install the ruby, and the compass

安装 ruby​​ 和指南针

In windows system we also need to set the path of ruby. Add the ruby/bin to path

在windows系统中我们还需要设置ruby的路径。将 ruby​​/bin 添加到路径

Then "grunt serve" works!

然后“咕噜声”起作用了!

回答by Franz

I have those problems too, I found a temporary fix by setting the source maps to false.

我也有这些问题,我通过将源映射设置为 false 找到了一个临时修复。

server: {
        options: {
          sourcemap: false <--
        }
      }

after that, it works like charm.

在那之后,它就像魅力一样。

回答by Trang Tung Nguyen

From the document of grunt-contrib-compass, that says:

grunt-contrib-compass的文档中,它说:

"This task requires you to have Ruby, Sass, and Compass >=1.0.1 installed" and "When you've confirmed you have Ruby installed, run gem update --system && gem install compass to install Compass and Sass."

“此任务要求您安装 Ruby、Sass 和 Compass >=1.0.1”和“当您确认安装了 Ruby 后,运行 gem update --system && gem install compass 以安装 Compass 和 Sass。”

I followed this instruction and fixed the warning.

我按照此说明并修复了警告。

回答by OSP

If you have the same strange feeling about Ruby when using node+express+Angluar, run "yo angular xyz", but use gulpinstead of grunt.

如果您在使用 node+express+Angluar 时对 Ruby 也有同样奇怪的感觉,请运行“yo angular xyz”,但使用gulp而不是 grunt。