Answer the question
In order to leave comments, you need to log in
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
npm install -g gulp --save-dev
'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'
// )
// ));
{
"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
You have executed the command:
The flag -g
means 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
Local gulp not found in ~\Downloads\Folder
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question