Kachimov
@Kachimov
медиа продакшн

Почему gulp stylus не компилируется в CSS, но на другом проекте все работает?

Делал один сайт и все работало, скопировал файлы и на их базе запускаю другой сайт, ошибка...

gulpfile.js идентичный с прошлым сайтом, на котором все компилилось, все перепробовал, все тщетно.

Давно была похожая проблема и помогло решение с github, но не в этом случае.
решение с github
You can resolve that issue by following methods:

Ensure dependencies described correctly on package.json
Just type npm install and hit Enter.
Check issue still exists. and If issue not resolved, continue these methods.
type npm cache clean and hit Enter
type sudo npm install -g npm and hit Enter.
Retry npm install and hit Enter.

Кэш чистил, все переустановил до последних версий и node и npm и gulp и пакеты после. Даже свой добрый win10 перезагружал)) Не вижу решения, что делаю не так?

СКРИН ОШИБКИ
3a227499e7274abe88b7646ddb33be13.jpg

win10x64
OpenServer 5.2.2
node v6.11.3
npm 3.10.10
gulp CLI version 1.3.0
stylus 0.54.5
проект на wordpress, то есть из папки styl собираю все в корень style.css

gulpfile.js
//'use strict';

// Project specific variables
var url = 'localhost/zay'; // Local dev URL. Change as needed.

// Load plugins
var gulp = require('gulp'),
  stylus = require('gulp-stylus'),
  //jeet = require('jeet'), // stylus grid
  autoprefixer = require('gulp-autoprefixer'),
  uglify = require('gulp-uglify'),
  minifyCss = require('gulp-uglifycss'),
  rupture = require('rupture'),
  rename = require('gulp-rename'),
  browserSync = require('browser-sync'),
  reload = browserSync.reload;

// Styles
gulp.task('styles', function(){
   gulp.src('./styl/*.styl') // Two files get compiled here: main stylsheet (all partials imported) and editor stylesheet. Makes for simple gulpfile config, but maybe not best approach. Comments welcome! 
  .pipe(stylus({
       //paths:  ['node_modules', 'styles/globals'],
       //import: ['rupture/rupture', 'variables', 'mixins'],
       use: [rupture()],
       //'include css': true,
       //'exclude':'node_modules',
       sourcemap: { inline: true }
     }))
  .pipe(autoprefixer({
      browsers: ['last 4 versions']
    }))
  .pipe(gulp.dest('./'))
  .pipe(reload({ stream : true }))
  // ---------------------------------------
  // Uncomment next 3 lines for minified css
  // ---------------------------------------
  // .pipe(rename({ suffix: '.min' }))
  // .pipe(minifyCss())
  // .pipe(gulp.dest('./'))
  console.log('Styles compiled!')
});

// Browser Sync
gulp.task('browser-sync', function(){
  browserSync({
    proxy: url
    })
});

// Watch!
gulp.task('watch', ['browser-sync'], function(){
 gulp.watch('./styl/**/*.styl', ['styles']);
  console.log('Styles watched!')
});

// Watch2!
gulp.task('watch2', ['styles', 'browser-sync'], function(){
  gulp.watch('./styl/**/*.styl', ['styles']);
  console.log('Styles watched!')
});
  • Вопрос задан
  • 383 просмотра
Пригласить эксперта
Ответы на вопрос 1
@Froggyweb
Написано же - не может найти variables.styl
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы