S
S
Sorulai2019-11-09 01:17:42
Node.js
Sorulai, 2019-11-09 01:17:42

Error running npm start with gulp dependencies?

I started learning gulp and everything related to preprocessors. Everything was going well, but I ran into this problem when running directly through npm:

λ npm start

> [email protected] start C:\Users\1\desktop\pinki
> npm run build && gulp serve


> [email protected] build C:\Users\1\desktop\pinki
> gulp less

[01:03:14] Using gulpfile ~\desktop\pinki\gulpfile.js
[01:03:14] Starting 'less'...
[01:03:15] The following tasks did not complete: less
[01:03:15] Did you forget to signal async completion?
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `gulp less`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\1\AppData\Roaming\npm-cache\_logs\2019-11-08T22_03_15_595Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `npm run build && gulp serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\1\AppData\Roaming\npm-cache\_logs\2019-11-08T22_03_15_828Z-debug.log

That being said, the gulp commands work.
Attached files:
gulpfile.js

var gulp = require("gulp");
var less = require("gulp-less");
var plumber = require("gulp-plumber");
var postcss = require("gulp-postcss");
var autoprefixer = require("autoprefixer");
var server = require("browser-sync").create();

gulp.task("less", function() {
  gulp.src("less/style.less")
  .pipe(plumber())
  .pipe(less())
  .pipe(postcss([
    autoprefixer()

    ]))
  .pipe(gulp.dest("build/css"))
  .pipe(server.stream());
});

gulp.task("serve", gulp.series("less"), function(){
server.init({
  server: "build/"
});

gulp.watch("less/**/*.less", gulp.series("less"));
gulp.watch("build/*.html")
  .on("change", server.reload);
});


And package.json file

{
  "name": "pinki",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "npm run build && gulp serve",
    "build": "gulp less"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "browser-sync": "^2.26.7",
    "eslint": "^6.6.0",
    "gulp": "^4.0.2",
    "gulp-autoprefixer": "^7.0.1",
    "gulp-plumber": "^1.2.1",
    "gulp-postcss": "^8.0.0",
    "stylelint": "^11.1.1"
  },
  "dependencies": {
    "gulp-less": "^4.0.1"
  }
}

I'll attach a debug if needed.
I searched everywhere, read the forums, but did not find anything intelligible, added path, tried to change the memory of js files, deleted the npm cache, all in vain.
I'm sitting on the second day with this, maybe there is something that I can't find, please help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey delphinpro, 2019-11-09
@Sorulai

[01:03:15] The following tasks did not complete: less
[01:03:15] Did you forget to signal async completion?

In plain text, they ask: Did you forget to signal async completion?
return gulp.src("less/style.less")

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question