首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >生成源映射错误-- grunt和sass配置

生成源映射错误-- grunt和sass配置
EN

Stack Overflow用户
提问于 2014-10-22 06:26:54
回答 2查看 2.4K关注 0票数 4

我正试着用沙司和咕噜。我在路上安装了红宝石,沙司和咕哝声。

版本是,

节点: 0.10.20 国家预防机制: 1.3.11 咕噜-cli: 0.1.13 咕噜声: 0.4.5 sass: 3.4.4

我的包裹是,

代码语言:javascript
复制
"private": true,
"devDependencies": {
    "express": "4.x",
    "grunt": "~0.4.1",
    "grunt-contrib-sass": "~0.3.0",
    "grunt-contrib-watch": "~0.4.4" 
}

我的抱怨文件是,

代码语言:javascript
复制
module.exports = function(grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        sass: {
            dist: {
                files: {
                    'style/style.css' : 'sass/home.scss'
                }
            }
        },
        watch: {
            css: {
                files: '**/*.scss',
                tasks: ['sass']
            }
        }
    });
    grunt.loadNpmTasks('grunt-contrib-sass');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.registerTask('default',['watch']);
}

现在,如果我尝试“咕噜”命令,我将得到以下错误。有什么帮助吗?

run:“咕噜”或“咕噜”或“咕噜”,

错误:

代码语言:javascript
复制
Running "sass:dist" (sass) task
Error: Error generating source map: couldn't determine public URL for the source
 stylesheet.
         No filename is available so there's nothing for the source map to link
to.
        on line  of standard input
  Use --trace for backtrace.
Warning: Error: Error generating source map: couldn't determine public URL for t
he source stylesheet.
         No filename is available so there's nothing for the source map to link
to.
        on line  of standard input
  Use --trace for backtrace. Use --force to continue.

Aborted due to warnings.

知道吗?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2014-10-22 06:40:38

看来你没有安装指南针。您可以运行gem install compass。在您最初的示例中,您将您的grunt文件设置为使用指南针,这将使您能够访问指南针、混合器和功能。

您的代码现在看起来很好,应该可以工作,但似乎找不到您的文件。当我在电脑旁边的时候,我也会这样做的。

同时,您可以在sass任务上尝试sourcemap: none选项。

更新:

对我来说很好。您能不能运行tree -I node_modules并发布输出(除非您认为有任何敏感信息),只为了再次检查文件是否在正确的位置?

我希望它看起来像这样

代码语言:javascript
复制
.
├── Gruntfile.js
├── package.json
├── sass
│   └── style.scss
└── style
    ├── style.css
    └── style.css.map

第二次更新:您的软件包似乎比我的新设置中的要老得多。要么从头开始,要么执行以下操作:

安装npm-检查更新

代码语言:javascript
复制
npm install npm-check-updates 

然后运行以下命令

  • npm-check-updates会告诉你哪些包过时了
  • npm-check-updates -u将更新package.json中的那些包
  • npm update更新所有过时的软件包。
票数 3
EN

Stack Overflow用户

发布于 2015-03-31 06:37:24

更新节点模块帮助..。

npm -检查更新将告诉您哪些包是过时的npm-检查更新-u将更新那些包在您的package.json npm更新,以更新您的所有过时的包。

票数 -2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26501454

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档