L
L
ligisayan2018-09-28 13:09:01
JavaScript
ligisayan, 2018-09-28 13:09:01

Why can't gulp build a project on another computer?

Hello! Can't figure out why gulp build fails. Run build
from console: gulp default
I get error

Local gulp not found in ~\Downloads\Folder

I install globally
npm install -g gulp --save-dev
and start again - the same error.
The files themselves:
gulpfile.js
'use strict';

global.$ = {
  path: {
    task: require('./gulp/path/tasks.js')
  },
  gulp: require('gulp'),
  del: require('del'),
  gp: require('gulp-load-plugins') (),
  browserSync: require('browser-sync').create()
};

$.path.task.forEach(function(taskPath) {
  require(taskPath) ();
});

$.gulp.task('default', $.gulp.series(
  'clean',
  $.gulp.parallel(
    'html',
    // 'pug',
    'sass:dev',
    'css:dev',
    'img:dev',
    'script:dev',
    'fonts'
    // 'video'
  ),
  $.gulp.parallel(
    'watch',
    'serve'
  )
));

$.gulp.task('build', $.gulp.series(
  'clean',
  $.gulp.parallel(
    'html',
    // 'pug',
    'sass:build',
    'css:build',
    'img:build',
    'script:build',
    'fonts'
    // 'video'
  ),
  $.gulp.parallel(
    'watch',
    'serve'
  )
));
// $.gulp.task('svgSprite', $.gulp.series(
// 	$.gulp.parallel(
// 		'svgSprite'
// 	)
// ));

package.json
{
  "name": "site",
  "version": "1.0.0",
  "description": "",
  "main": "gulpfile.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "browser-sync": "^2.24.7",
    "del": "^3.0.0",
    "gulp": "github:gulpjs/gulp#4.0",
    "gulp-autoprefixer": "^6.0.0",
    "gulp-html-beautify": "^1.0.1",
    "gulp-load-plugins": "^1.5.0",
    "gulp-notify": "^3.2.0",
    "gulp-prettify": "^0.5.0",
    "gulp-pug": "^4.0.1",
    "gulp-sass": "^4.0.1",
    "gulp-sourcemaps": "^2.6.4"
  }
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mikhail Korobkov, 2018-09-28
@ligisayan

You have executed the command:
The flag -gmeans a global installation on the system.
I doubt that in this case it is possible to --save-dev
use gulp-cli. different projects may use different versions of gulp.
Let's say if one project uses gulp 3.9 and the other 4, then there will be problems using the global gulp.
So let's install gulp-cli globally:
Then run to make sure gulp-cli installed successfully.
Next, in the package.json folder, run the command to install the packages necessary to execute gulpfile
. You can start the default task with the command: gulp, it is not necessary to specify default

S
Sergey delphinpro, 2018-09-28
@delphinpro

Local gulp not found in ~\Downloads\Folder

Galp local installation not found.
Did you do npm install?
although of course they did ...
Maybe the problem is in the Cyrillic path to the project? Since the days of DOS/WIN98 I have not trusted the Cyrillic alphabet in the file system.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question