Error in plugin «gulp-sass»
Message:
gulp-sass 5 does not have a default Sass compiler; please set one yourself.
Both the sass
and node-sass
packages are permitted.
For example, in your gulpfile:
var sass = require('gulp-sass')(require('sass'));
This is my code below . It says var sass = require(‘gulp-sass’)(require(‘sass’)); in the error but I am using import and none of the solution worked for me
I am new to this and the cli version is 2.3.0 local version is 4.0.2
please give me a solution I am stuck here for days
import gulp from 'gulp';
import sass from 'gulp-sass';
import yargs from 'yargs';
const PRODUCTION = yargs.argv.prod;
export const styles = () => {
return gulp.src('src/assets/scss/bundle.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('dist/asset/css'));
}
askcoder
3031 gold badge3 silver badges8 bronze badges
asked Jul 17, 2021 at 5:23
I had this problem and found that adding the standard sass npm npm install --save-dev sass
and then adding the second section of the error message to my variable so that it looks like this const sass = require('gulp-sass')(require('sass'));
worked.
Dharman♦
29.3k21 gold badges80 silver badges131 bronze badges
answered Aug 4, 2021 at 11:22
3
If you, like me, use a modular system. Then this solution should help you!
You need to install SASS
It is also necessary that the gulp-sass be installed
import pkg from 'gulp';
const { src, dest, series, watch } = pkg;
import concat from 'gulp-concat'
import dartSass from 'sass'
import gulpSass from 'gulp-sass'
const sass = gulpSass(dartSass)
function scss() {
return src('app/scss/**/*.scss', { sourcemaps: true })
.pipe(sass.sync().on('error', sass.logError)) // scss to css
.pipe(concat('style.min.css'))
.pipe(dest(config.build.style, { sourcemaps: '../sourcemaps/' }))
}
async function builds() { scss() }
export { builds }
answered Sep 5, 2021 at 19:56
Brendan8cBrendan8c
3092 silver badges9 bronze badges
if I used gulp-sass
import dartSass from 'sass';
import gulpSass from 'gulp-sass';
const sass = gulpSass( dartSass );
else if I used node-sass
import gulpSass from "gulp-sass";
import nodeSass from "node-sass";
const sass = gulpSass(nodeSass);
on another state when I used required
var sass = require('gulp-sass')(require('sass'));
answered Feb 10, 2022 at 6:54
I had the same problem. This is my solution:
npm install sass
npm install gulp-sass
My version sass -«^1.51.0» and gulp-sass — «^5.1.0» in package.json
const sass = require('gulp-sass')(require('sass'));
gulp.task('styles', () => (
gulp.src('src/**/*.scss')
.pipe(sass())
.pipe(concat('style.css'))
.pipe(gulp.dest('public'))
))
answered May 12, 2022 at 19:39
You need just istall in aditional SASS
In terminal:
npm i sass
And replace:
sass = require(‘gulp-sass’);
For:
sass = require(‘gulp-sass’)(require(‘sass’));
answered Sep 6, 2022 at 11:26
I got same error and i did follow.
1. At first I installed gulp-sass
npm install sass gulp-sass --save-dev
2. Then on my gulpfile.babel.js I added
import gulpsass from 'gulp-sass';
3. And lastly above the function I added
var sass = require('gulp-sass')(require('sass'));
Here is the final image of my gulp file:
skomisa
15.5k7 gold badges59 silver badges99 bronze badges
answered Jan 17 at 11:35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
Sign in
to your account
Closed
lindeberg opened this issue
Feb 5, 2016
· 7 comments
Comments
Software:
- Node: v4.2.6 (x64)
- npm: latest, I think, I downloaded it today ^^
- Gulp: 3.9.0
- gulp-sass: 2.2.0
- OS: Windows 7
- IDE: Visual Studio 2015 (Web Essentials 2015)
It compiles properly when I have basic sass like this:
https://i.gyazo.com/e5f30a66e6cfe23466d3416fab7805a9.png
But when I try to compile with the partials imported I get an error:
https://i.gyazo.com/d5fdc3e2ffc0df588ecd7586c479463e.png
Starting 'sass-compile'...
Error in plugin 'sass'
Message:
Content/Styles/application.scss
undefined
Finished 'sass-compile'
Process terminated with code 0.
I’ve tried importing just one of the partials, with very clean, basic sass inside, and everything, but I still get the error.
I’m very new to node and task managers. I probably haven’t given you enough of information, please tell me what you need to know! I hope you do not hate me because I’m just providing you with images — but I am not at the office right now and I can’t get this problem out of my mind. Sorry!
Issue is not present for me with the following settings (slightly outdated compared to yours).
- Node: 4.0.0
- npm: 2.14.2
- Gulp: 3.9.0
- gulp-sass: 2.1.1
- OS: Mac OS X 10.11
- Running gulp from Terminal
I’ll try a pass running the same setup as you (only on linux) via docker shortly here and report back.
Running pretty similar to you here on a different platform and my demo (using your gulpfile, slightly different directory structure).
If you want to link to a repo with a setup that is failing on your end I can give it a try, may need someone running windows to give it a try too though.
EDIT:
Also, just for good measure can you try to include only one partial and then try to run it? Maybe something in partials/_partial1.scss
which would be @import "partials/partial1";
. Here’s my current directory structure if it helps.
I faced similar problem (image) when the project folder was located:
C:UsersЕвгенийDesktoptemplate
I solved the problem by moving the folder template
to the root of drive C.
Software:
- Windows 10 (x64)
- Node: 5.5.0 Stable (x64)
- Gulp: 3.9.0
- gulp-sass: 2.2.0
UPD: I tried to move the folder and noticed that the error occurs only when path contains non-Latin characters.
There is a known issue with LibSass and directories with Cyrillic characters. This may also apply to other non-ascii characters. Please try the gulp-sass beta for the patch.
npm install gulp-sass@beta
Try to replace on package.json of gulp-sass, instead of
"node-sass": "^3.4.2"
with
"node-sass": "^3.5.0-beta.1"
This worked for me 👍
@xzyfer, yes, it solved the problem for me.
Hey, I am getting same error when i am trying to customize an online open source template. After extracting the .zip file from above location I am running following sets of command in command prompt. Note — node.js is already installed in my system.
npm install -g gulp //installing gulp globally
npm init //initialization
npm install --save-dev gulp //installing gulp locally - dev utility
npm install -g npm-install-all
npm-install-all gulpfile.js //Installing all required modules from gulpfile.js
After preparing my env. when i run the gulp task defined in the gulpfile.js using following code, it throws the mentioned error:
C:Usersmy_userDocumentsmy_project>gulp build
[18:42:36] Using gulpfile ~Documentsmy_projectgulpfile.js
[18:42:36] Starting 'build'...
[18:42:36] Starting 'clean:dist'...
[18:42:36] Finished 'clean:dist' after 4.27 ms
[18:42:36] Starting 'scss'...
Error in plugin 'sass'
Message:
assetsscsscustom_mixins.scss
Error: File to import not found or unreadable: custom/mixins/alert.scss.
on line 1 of assets/scss/custom/_mixins.scss
from line 28 of assets/scss/argon.scss
>> @import "custom/mixins/alert.scss";
^
[18:42:37] Finished 'scss' after 805 ms
[18:42:37] Starting 'copy:css'...
[18:42:37] Finished 'copy:css' after 33 ms
[18:42:37] Starting 'copy:js'...
[18:42:37] Finished 'copy:js' after 11 ms
[18:42:37] Starting 'minify:js'...
[18:42:37] Finished 'minify:js' after 128 ms
[18:42:37] Starting 'minify:css'...
[18:42:38] Finished 'minify:css' after 992 ms
[18:42:38] Finished 'build' after 2 s
The content of all the file is unchanged and is the same as the git repo. So, incase if one wants to refer, one can check the link attached earlier.
I am using a windows-10 machine with:
>npm -v
6.4.1
>node -v
v8.12.0
>gulp -v
[19:04:01] CLI version 3.9.1
[19:04:01] Local version 3.9.1
Содержание
- Как исправить ошибку gulp4 Error in plugin «sass»?
- Cannot compile imports — Error in plugin ‘sass’ #438
- Comments
- Error in plugin sass. Help #345
- Comments
- Error in plugin ‘sass’: Running ‘gulp build’ throws error while working on “creative-tim” open source template. #47
- Comments
- Gulp-sass: Невозможно скомпилировать импорт — ошибка в плагине «sass»
- Все 7 Комментарий
Как исправить ошибку gulp4 Error in plugin «sass»?
После обновления в консоли стало выдавать ошибку:
Error in plugin «sass»
Message:
catalogviewtheme. stylesheetstylesheet.sass
Error: Expected spaces, was tabs.
╷
13 │ font-family: ‘Tavolga Free’
│ ^^^^
╵
catalogviewtheme. stylesheetstylesheet.sass 13:1 root stylesheet
Ранее такой ошибки не было. Подскажите, пожалуйста, где исправить. В интернете ничего не нашла. Заранее, спасибо!
Вот файл gulpfile.js
// Подключаем Gulp и все необходимые библиотеки
const < src, dest, parallel, series, watch >= require(‘gulp’);
const browserSync = require(‘browser-sync’).create();
const concat = require(‘gulp-concat’);
const uglify = require(‘gulp-uglify-es’).default;
const sass = require(‘gulp-sass’)(require(‘sass’));
const autoprefixer = require(‘gulp-autoprefixer’);
const bourbon = require(‘node-bourbon’);
const cleancss = require(‘gulp-clean-css’);
const newer = require(‘gulp-newer’);
const imagemin = require(‘gulp-imagemin’);
const del = require(‘del’);
const svgstore = require(‘gulp-svgstore’);
const rename = require(‘gulp-rename’);
function browsersync() <
browserSync.init( <
proxy: ‘. loc/’,
notify: false,
online: false
>)
>
function scripts() <
return src([
‘node_modules/jquery/dist/jquery.min.js’,
‘catalog/view/theme/. /js/**/*.js’,
])
.pipe(concat(‘theme.min.js’))
.pipe(uglify())
.pipe(dest(‘catalog/view/theme/. /js/’))
.pipe(browserSync.stream())
>
function styles() <
return src(‘catalog/view/theme/. /stylesheet/stylesheet.sass’)
.pipe(sass( <
includePaths: bourbon.includePaths
>).on(‘error’, sass.logError))
.pipe(concat(‘stylesheet.css’))
.pipe(autoprefixer(< overrideBrowserslist: [‘last 25 versions’], grid: true >))
.pipe(cleancss(( < level: < 1: < specialComments: 0 >>, /*format: ‘beautify’*/ > )))
.pipe(dest(‘catalog/view/theme/. /stylesheet/’))
.pipe(browserSync.stream())
>
function images() <
return src(‘image/catalog/**/*’)
.pipe(newer(‘image/cashe/catalog/’))
.pipe(imagemin())
.pipe(dest(‘image/cashe/catalog/’))
>
function cleanimg() <
return del(‘image/cashe/catalog/**/*’, < force: true >)
>
Источник
Cannot compile imports — Error in plugin ‘sass’ #438
Software:
- Node: v4.2.6 (x64)
- npm: latest, I think, I downloaded it today ^^
- Gulp: 3.9.0
- gulp-sass: 2.2.0
- OS: Windows 7
- IDE: Visual Studio 2015 (Web Essentials 2015)
But when I try to compile with the partials imported I get an error:
https://i.gyazo.com/d5fdc3e2ffc0df588ecd7586c479463e.png
I’ve tried importing just one of the partials, with very clean, basic sass inside, and everything, but I still get the error.
I’m very new to node and task managers. I probably haven’t given you enough of information, please tell me what you need to know! I hope you do not hate me because I’m just providing you with images — but I am not at the office right now and I can’t get this problem out of my mind. Sorry!
The text was updated successfully, but these errors were encountered:
Issue is not present for me with the following settings (slightly outdated compared to yours).
- Node: 4.0.0
- npm: 2.14.2
- Gulp: 3.9.0
- gulp-sass: 2.1.1
- OS: Mac OS X 10.11
- Running gulp from Terminal
I’ll try a pass running the same setup as you (only on linux) via docker shortly here and report back.
Running pretty similar to you here on a different platform and my demo (using your gulpfile, slightly different directory structure).
If you want to link to a repo with a setup that is failing on your end I can give it a try, may need someone running windows to give it a try too though.
EDIT:
Also, just for good measure can you try to include only one partial and then try to run it? Maybe something in partials/_partial1.scss which would be @import «partials/partial1»; . Here’s my current directory structure if it helps.
I faced similar problem (image) when the project folder was located:
C:UsersЕвгенийDesktoptemplate
I solved the problem by moving the folder template to the root of drive C.
Software:
- Windows 10 (x64)
- Node: 5.5.0 Stable (x64)
- Gulp: 3.9.0
- gulp-sass: 2.2.0
UPD: I tried to move the folder and noticed that the error occurs only when path contains non-Latin characters.
There is a known issue with LibSass and directories with Cyrillic characters. This may also apply to other non-ascii characters. Please try the gulp-sass beta for the patch.
Try to replace on package.json of gulp-sass, instead of
«node-sass»: «^3.4.2»
with
«node-sass»: «^3.5.0-beta.1»
This worked for me 👍
@xzyfer, yes, it solved the problem for me.
Hey, I am getting same error when i am trying to customize an online open source template. After extracting the .zip file from above location I am running following sets of command in command prompt. Note — node.js is already installed in my system.
After preparing my env. when i run the gulp task defined in the gulpfile.js using following code, it throws the mentioned error:
Documentsmy_projectgulpfile.js [18:42:36] Starting ‘build’. [18:42:36] Starting ‘clean:dist’. [18:42:36] Finished ‘clean:dist’ after 4.27 ms [18:42:36] Starting ‘scss’. Error in plugin ‘sass’ Message: assetsscsscustom_mixins.scss Error: File to import not found or unreadable: custom/mixins/alert.scss. on line 1 of assets/scss/custom/_mixins.scss from line 28 of assets/scss/argon.scss >> @import «custom/mixins/alert.scss»; ^ [18:42:37] Finished ‘scss’ after 805 ms [18:42:37] Starting ‘copy:css’. [18:42:37] Finished ‘copy:css’ after 33 ms [18:42:37] Starting ‘copy:js’. [18:42:37] Finished ‘copy:js’ after 11 ms [18:42:37] Starting ‘minify:js’. [18:42:37] Finished ‘minify:js’ after 128 ms [18:42:37] Starting ‘minify:css’. [18:42:38] Finished ‘minify:css’ after 992 ms [18:42:38] Finished ‘build’ after 2 s»>
The content of all the file is unchanged and is the same as the git repo. So, incase if one wants to refer, one can check the link attached earlier.
Источник
Error in plugin sass. Help #345
After compiling the css.sass, while making some changes, the css file disappear and when trying to npm start again this is what happen.
foundation-emails-template@1.0.0 start /Users/jhulio/foundation-emails-template
gulp
[16:01:41] Requiring external module babel-register
[16:01:41] Using gulpfile
/foundation-emails-template/gulpfile.babel.js
[16:01:41] Starting ‘default’.
[16:01:41] Starting ‘build’.
[16:01:41] Starting ‘clean’.
[16:01:41] Finished ‘clean’ after 4.82 ms
[16:01:41] Starting ‘pages’.
[16:01:42] Finished ‘pages’ after 286 ms
[16:01:42] Starting ‘sass’.
Error in plugin ‘sass’
Message:
src/assets/scss/_settings.scss
Error: argument $color of darken($color, $amount) must be a color
[16:01:42] Finished ‘sass’ after 34 ms
[16:01:42] Starting ‘images’.
[16:01:42] gulp-imagemin: Minified 0 images
[16:01:42] Finished ‘images’ after 67 ms
[16:01:42] Starting ‘inline’.
[16:01:42] ‘inline’ errored after 2.58 ms
[16:01:42] Error: ENOENT: no such file or directory, open ‘dist/css/app.css’
at Error (native)
at Object.fs.openSync (fs.js:549:18)
at Object.fs.readFileSync (fs.js:397:15)
at inliner (gulpfile.babel.js:94:16)
at inline (gulpfile.babel.js:72:28)
at bound (domain.js:287:14)
at runBound (domain.js:300:12)
at asyncRunner (/Users/jhulio/foundation-emails-template/node_modules/async-done/index.js:36:18)
at nextTickCallbackWith0Args (node.js:420:9)
at process._tickDomainCallback (node.js:390:13)
[16:01:42] ‘build’ errored after 414 ms
[16:01:42] ‘default’ errored after 416 ms
npm ERR! Darwin 15.3.0
npm ERR! argv «/usr/local/bin/node» «/Users/jhulio/.npm-packages/bin/npm» «start»
npm ERR! node v4.4.3
npm ERR! npm v3.5.1
npm ERR! code ELIFECYCLE
npm ERR! foundation-emails-template@1.0.0 start: gulp
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the foundation-emails-template@1.0.0 start script ‘gulp’.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the foundation-emails-template package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! gulp
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs foundation-emails-template
npm ERR! Or if that isn’t available, you can get their info via:
npm ERR! npm owner ls foundation-emails-template
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/jhulio/foundation-emails-template/npm-debug.log
jhulio: /Users/jhulio/foundation-emails-template
The text was updated successfully, but these errors were encountered:
Источник
Error in plugin ‘sass’: Running ‘gulp build’ throws error while working on “creative-tim” open source template. #47
I am new to sass/css/web design and i am trying to customize the argon template for my project. After extracting the .zip file from above location I am running following sets of command in command prompt. Note — node.js is already installed in my system.
After preparing my env. when i run the gulp task defined in the gulpfile.js using following code, it throws the mentioned error:
Documentsmy_projectgulpfile.js [18:42:36] Starting ‘build’. [18:42:36] Starting ‘clean:dist’. [18:42:36] Finished ‘clean:dist’ after 4.27 ms [18:42:36] Starting ‘scss’. Error in plugin ‘sass’ Message: assetsscsscustom_mixins.scss Error: File to import not found or unreadable: custom/mixins/alert.scss. on line 1 of assets/scss/custom/_mixins.scss from line 28 of assets/scss/argon.scss >> @import «custom/mixins/alert.scss»; ^ [18:42:37] Finished ‘scss’ after 805 ms [18:42:37] Starting ‘copy:css’. [18:42:37] Finished ‘copy:css’ after 33 ms [18:42:37] Starting ‘copy:js’. [18:42:37] Finished ‘copy:js’ after 11 ms [18:42:37] Starting ‘minify:js’. [18:42:37] Finished ‘minify:js’ after 128 ms [18:42:37] Starting ‘minify:css’. [18:42:38] Finished ‘minify:css’ after 992 ms [18:42:38] Finished ‘build’ after 2 s»>
The content of all the file is unchanged and is the same as the git repo. So, incase if one wants to refer, one can check the link attached earlier.
I am using a windows-10 machine with:
The text was updated successfully, but these errors were encountered:
Источник
Gulp-sass: Невозможно скомпилировать импорт — ошибка в плагине «sass»
Программное обеспечение:
- Узел: v4.2.6 (x64)
- npm: последний, кажется, сегодня скачал ^^
- Глоток: 3.9.0
- глоток-дерзость: 2.2.0
- ОС: Виндовс 7
- IDE: Visual Studio 2015 (веб-основы 2015)
Он компилируется правильно, когда у меня есть базовый sass, подобный этому:
https://i.gyazo.com/e5f30a66e6cfe23466d3416fab7805a9.png
Но когда я пытаюсь скомпилировать импортированные части, я получаю сообщение об ошибке:
https://i.gyazo.com/d5fdc3e2ffc0df588ecd7586c479463e.png
Я пытался импортировать только один из фрагментов с очень чистым, базовым sass внутри и всем остальным, но я все еще получаю сообщение об ошибке.
Я очень новичок в узлах и диспетчерах задач. Я, вероятно, не дал вам достаточно информации, пожалуйста, скажите мне, что вам нужно знать! Я надеюсь, вы не ненавидите меня, потому что я просто предоставляю вам изображения, но я сейчас не в офисе, и я не могу выбросить эту проблему из головы. Прости!
Известна проблема с LibSass и каталогами с кириллическими символами. Это также может относиться к другим символам, отличным от ascii. Пожалуйста, попробуйте бета-версию патча gulp-sass.
Все 7 Комментарий
Проблема у меня отсутствует со следующими настройками (немного устаревшими по сравнению с вашими).
- Узел: 4.0.0
- нпм: 2.14.2
- Глоток: 3.9.0
- глоток-дерзость: 2.1.1
- ОС: Mac OS X 10.11
- Запуск gulp из терминала
Вскоре я попробую запустить ту же настройку, что и вы (только в Linux) через докер, и отчитаюсь.
Работает примерно так же, как вы здесь, на другой платформе и в моей демонстрации (с использованием вашего gulpfile, немного другой структуры каталогов).
Если вы хотите связать репо с настройкой, которая не работает с вашей стороны, я могу попробовать, хотя может потребоваться, чтобы кто-то, работающий под управлением Windows, тоже попробовал.
РЕДАКТИРОВАТЬ:
Кроме того, на всякий случай, можете ли вы попробовать включить только один фрагмент, а затем попытаться запустить его? Может быть, что-то в partials/_partial1.scss , которое будет @import «partials/partial1»; . Вот моя текущая структура каталогов, если это поможет.
Я столкнулся с аналогичной проблемой ( изображение ), когда папка проекта находилась:
C:UsersЕвгенийDesktoptemplate
Я решил проблему, переместив папку template в корень диска C.
Программное обеспечение:
- Windows 10 (x64)
- Узел: 5.5.0 Стабильная (x64)
- Глоток: 3.9.0
- глоток-дерзость: 2.2.0
UPD: Пробовал переместить папку и заметил, что ошибка возникает только тогда, когда путь содержит нелатинские символы.
Известна проблема с LibSass и каталогами с кириллическими символами. Это также может относиться к другим символам, отличным от ascii. Пожалуйста, попробуйте бета-версию патча gulp-sass.
Попробуйте заменить на package.json gulp-sass вместо
«node-sass»: «^3.4.2»
с участием
«node-sass»: «^3.5.0-beta.1»
Это сработало для меня :+1:
@xzyfer , да, это решило проблему для меня.
Эй, я получаю ту же ошибку, когда пытаюсь настроить онлайн- шаблон с открытым исходным кодом. После извлечения файла .zip из указанного выше места я запускаю следующие наборы команд в командной строке. Примечание. В моей системе уже установлен node.js.
После подготовки моего env. когда я запускаю задачу gulp, определенную в gulpfile.js, используя следующий код, она выдает указанную ошибку:
Содержимое всех файлов не изменилось и совпадает с репозиторием git. Итак, если кто-то хочет сослаться, можно проверить ссылку, прикрепленную ранее.
Источник
Здравствуйте, Александр! Проблема в следующем. Настроила по вашему уроку сборку проекта с помощью gulp, целый день все отлично работало (огромное спасибо вам за уроки
!!). Но в какой-то момент при запуске задачи css:build gulp-plumber начал выдавать ошибку в плагине gulp-sass, ссылаясь при этом на ошибки в исходных файлах бутстрапа, которые я, естественно, не правила:
Message:
node_modulesbootstrapscss_tables.scss
Error: Function theme-color-level finished without @return
on line 101 of node_modules/bootstrap/scss/_tables.scss, in function `theme-color-level`
from line 101 of node_modules/bootstrap/scss/_tables.scss
from line 14 of assets/src/style/main.scss
>> @include table-row-variant($color, theme-color-level($color, $table-bg-lev
-------------------------------------^
Details:
status: 1
file: C:/Obr/node_modules/bootstrap/scss/_tables.scss
line: 101
column: 38
formatted: Error: Function theme-color-level finished without @return
on line 101 of node_modules/bootstrap/scss/_tables.scss, in function `theme-color-level`
from line 101 of node_modules/bootstrap/scss/_tables.scss
from line 14 of assets/src/style/main.scss
>> @include table-row-variant($color, theme-color-level($color, $table-bg-lev
-------------------------------------^
messageFormatted: node_modulesbootstrapscss_tables.scss
Error: Function theme-color-level finished without @return
on line 101 of node_modules/bootstrap/scss/_tables.scss, in function `theme-color-level`
from line 101 of node_modules/bootstrap/scss/_tables.scss
from line 14 of assets/src/style/main.scss
>> @include table-row-variant($color, theme-color-level($color, $table-bg-lev
-------------------------------------^
messageOriginal: Function theme-color-level finished without @return
relativePath: node_modulesbootstrapscss_tables.scss
Подскажите, что могло произойти и как теперь восстановить статус-кво? Заранее приношу извинения за тупизм, я гуманитарий-самоучка, базовых знаний катастрофически не хватает(((
Hello Guys, How are you all? Hope You all Are Fine. Today in nodejs. So Here I am Explain to you all the possible solutions here.
Without wasting your time, Let’s start This Article to Solve This Error.
Contents
- How gulp-sass 5 does not have a default Sass compiler; please set one yourself. Both the
sass
andnode-sass
packages are permitted Error Occurs ? - How To Solve gulp-sass 5 does not have a default Sass compiler; please set one yourself. Both the
sass
andnode-sass
packages are permitted Error ? - Solution 1
- Solution 2
- Summery
I am just want to use gulp-sass and sass. But I am getting the following error.
Error in plugin "gulp-sass"
Message:
gulp-sass 5 does not have a default Sass compiler; please set one yourself.
Both the `sass` and `node-sass` packages are permitted.
For example, in your gulpfile:
Here is my code.
var sass = require('gulp-sass')(require('sass'));
How To Solve gulp-sass 5 does not have a default Sass compiler; please set one yourself. Both the sass
and node-sass
packages are permitted Error ?
- How To Solve gulp-sass 5 does not have a default Sass compiler; please set one yourself. Both the
sass
andnode-sass
packages are permitted Error ?To Solve gulp-sass 5 does not have a default Sass compiler; please set one yourself. Both the
sass
andnode-sass
packages are permitted Try this to import instead of requiring. import gulpSass from “gulp-sass”; import nodeSass from “node-sass”; const sass = gulpSass(nodeSass);
Solution 1
Try this to import instead of requiring.
import gulpSass from "gulp-sass";
import nodeSass from "node-sass";
const sass = gulpSass(nodeSass);
Solution 2
import dartSass from 'sass';
import gulpSass from 'gulp-sass';
const sass = gulpSass( dartSass );
Summery
It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?
Also Read
- SyntaxError: invalid syntax to repo init in the AOSP code.
- Главная
- Вопросы
Здравствуйте! Прохожу урок https://beonmax.com/courses/web-razrabotchik/gulp-planirovschik-zadach/ , при запуске gulp после установки всех плагинов в терминале выдается ошибка:
«
[14:12:55] Using gulpfile ~DesktopверсткаUbergulpfile.js
[14:12:55] Starting ‘default’…
[14:12:55] Starting ‘watch’…
[14:12:55] Starting ‘server’…
[14:12:55] Starting ‘styles’…
Error in plugin «gulp-sass»
Message:
gulp-sass 5 does not have a default Sass compiler; please set one yourself.
Both the `sass` and `node-sass` packages are permitted.
For example, in your gulpfile:
var sass = require(‘gulp-sass’)(require(‘sass’));
[14:12:55] The following tasks did not complete: default, watch, server, styles
[14:12:55] Did you forget to signal async completion?
«
Из фразы gulp-sass 5 does not have a default Sass compiler; please set one yourself понимаю, что нужно установить компилер, подскажите, пожалуйста, как это правильно сделать и исправить ошибку? Хочется дальше продолжать полноценное обучение по курсу.
Ирина Белоусова
1 year ago
- Активные
- Старые
- Голоса
Добрый день. Буквально несколько дней назад пакет gulp-sass обновился и требует чуть другой настройки (уже поместили в документацию)
Для исправления ошибки установите сначала пакет sass через команду
npm i sass —save-dev
Дальше в gulpfile измените аналогичную строку на
const sass = require(‘gulp-sass’)(require(‘sass’));
Иван Петриченко
1 year ago
Сработало, спасибо большое, Иван, за помощь и, в целом, за ваши курсы!) Буду продолжать обучение.
Ирина Белоусова
1 year ago
2 ответов
Following along with Kevin Powell and his video on how to set up Sass and BrowserSync. After I setup my gulpfile.js file and I try to run ‘gulp style’ in the terminal I get the following error.
Error in plugin "gulp-sass"
Message:
gulp-sass 5 does not have a default Sass compiler; please set one yourself.
Both the `sass` and `node-sass` packages are permitted.
For example, in your gulpfile:
var sass = require('gulp-sass')(require('sass'));
[12:59:23] The following tasks did not complete: style
[12:59:23] Did you forget to signal async completion?
I’m pretty new to setting up this stuff on my local machine so I’m fairly certain I’m missing one small thing. Any help is much appreciated.
Here’s my code that’s in gulpfile.js
const gulp = require('gulp');
const sass = require('gulp-sass');
const browserSync = require('browser-sync').create();
//compile scss into css
function style() {
// 1. where is scss file
return gulp.src('./scss/**/*.scss')
// 2. pass that file through sass compiler
.pipe(sass())
// 3. where do I save the compiled CSS?
.pipe(gulp.dest('./css'))
}
exports.style = style;
Thanks