V
V
Volodya2017-09-17 11:22:19
css
Volodya, 2017-09-17 11:22:19

Why doesn't gulp stylus compile to CSS, but everything works on another project?

I made one site and everything worked, I copied the files and based on them I launch another site, an error ...
gulpfile.js is identical to the previous site, on which everything was compiled, I tried everything, everything is in vain.
There was a similar problem for a long time and the solution from github helped, but not in this case.

solution from 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.

I cleared the cache, reinstalled everything to the latest versions of both node and npm and gulp and packages after. I even rebooted my good win10)) I don’t see a solution, what am I doing wrong?
SCREEN ERRORS
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
project on wordpress, i.e. I collect everything from the styl folder to the style.css root
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!')
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Froggyweb, 2017-09-17
@Froggyweb

Written same - can't find variables.style

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question