A
A
Andrej Sharapov2019-07-30 10:53:03
ubuntu
Andrej Sharapov, 2019-07-30 10:53:03

Why can't Gulp-Sass install on Ubuntu?

Hi all!
I created a project, I connect gulp-sass npm i -D node-sass gulp-sass, when the task is executed, it displays an error Error: Cannot find module 'node-sass'. With what it can be connected?
The command npm -v gulp-sassoutputs 6.9.0. That is, the module exists. It is also available in the folder node_modules...
The task is the simplest, there are no errors

const
    gulp = require('gulp'),
    sass = require('gulp-sass');

gulp.task('sass', () => {
    return gulp.src('build/sass/to_pages/*.sass')
        .pipe(sass({
            outputStyle: 'compressed'
        }).on('error', sass.logError))
        .pipe(gulp.dest('./css'));
});

I put it separately npm i -D node-sass- it gave out Error: Cannot find module 'gulp-sass'
Ok, I put it.
Installation npm i -D gulp-sassand further launch displays information about its absence: Error: Cannot find module 'gulp-sass', the node_modulesfolder is gulp-sassempty.
And so in a circle in short ...

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Martovitskiy, 2019-07-30
@Martovitskiy

What if npm update and then npm i gulp-sass ?
And as an option
npm install

K
KazeZlat, 2017-11-22
@djamali

Maybe you mean
new_arr[j]=arr[i];?
Just why would it be if you have an array ? In general, the loop in this case is not the best solution, because there is a sort function that accepts a callback:arr[2]defined["world2", "Hello1"]

var arr = ['world2', 'Hello1'];
arr.sort(function(a, b){
  return a.replace(/\D/g, '') - b.replace(/\D/g, '');
});
console.log(arr); // ["Hello1", "world2"]

/\D/g- a regular expression meaning "Not a digit" with the modifier g- Global, which does not stop after the first match.
The replace function looks for occurrences of the first argument (string or regular expression) in a string and replaces them with the second argument (string).

G
Good Samaritan, 2017-11-22
@djamali

function order(words){
  var arr=words.split(" ");
  var new_arr=[];
  for(var i=0;i<arr.length;i++){
    for(var j=1;j<=9;j++){
      if(arr[i].indexOf(j)>-1){
        //console.log(i,j,arr[i]);
        new_arr[j]=arr[i];
      }
    }
  }
return new_arr.join(" ").substr(1);

}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question