【发布时间】:2015-10-24 10:52:15
【问题描述】:
我正在尝试在我的第一个 Angular 项目中使用 grunt。我正在尝试在我的项目中使用 sass。我遵循此链接的所有步骤 http://blog.meredithunderell.com/2014/07/24/setting-up-twitter-bootstrap-sass-with-grunt-in-an-angularjs-project/
我正在尝试使用 sass 将 .sass 文件转换为 css 文件。但是当我运行我的项目时,我收到了错误
MacBook-Pro:test_saas naveenkumar$ grunt sass
Running "sass:dist" (sass) task
Warning:
You need to have Ruby and Sass installed and in your PATH for this task to work.
More info: https://github.com/gruntjs/grunt-contrib-sass
Use --force to continue.
Aborted due to warnings.
MacBook-Pro:test_saas naveenkumar$
在上面的链接中没有写出这种类型的错误或警告 你能告诉我如何解决这个错误
这是我的 gruntfile.js
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
project: {
app: ['app'],
assets: ['<%= project.app %>/assets'],
css: ['<%= project.assets %>/sass/style.scss']
},sass: {
dist:{
files:{
'app/assets/css/style.css':'app/assets/css/style.scss'
}
}
//dev: {
// options: {
// style: 'expanded'},
// files: {
// '<%= project.assets %>/css/style.css':'<%= project.css %>'
// }
//}
},watch: {
sass: {
files: '<%= project.assets %>/sass/{,*/}*.{scss,sass}',
tasks: ['sass']
}
}
});
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', [
'watch'
]);
};
更新
安装 sass 后出现此错误
MacBook-Pro:test_saas naveenkumar$ grunt sass
Running "sass:dist" (sass) task
Errno::ENOENT: No such file or directory - undefined
Use --trace for backtrace.
Warning: Exited with error code 1 Use --force to continue.
Aborted due to warnings.
【问题讨论】:
-
你安装了 Sass 吗?
-
我不太了解..如何安装sass..我没有写sass安装教程
标签: angularjs angularjs-directive sass gruntjs angularjs-scope