How to run gulp?

installed opencart locally (mamp).
I am now trying to run gulp.
Did you install gulp: npm i -g gulp
Did you install the c package.json: npm i
started gulp: gulp
in the browser I enter localhost:3000 and nothing just stands and all.
package.json
{
 "name": "opencart-project",
 "version": "1.0.0",
 "description": "Gulp OpenCart Project",
 "main": "gulpfile.js",
 "scripts": {
 "test": "echo \"Error: no test specified\" && exit 1"
},
 "author": "WebDesign Master",
 "license": "ISC",
 "devDependencies": {
 "browser-sync": "^2.15.0",
 "gulp": "^3.9.1",
 "gulp-autoprefixer": "^3.1.1",
 "gulp-clean-css": "^2.0.12",
 "gulp-sass": "^2.3.2",
 "gulp-util": "^3.0.7",
 "node-bourbon": "^4.2.8",
 "vinyl-ftp": "^0.5.0"
}
}


gulpfile.js
// Plugin Gulp and all required libraries
var gulp = require('gulp'),
 gutil = require('gulp-util' ),
 sass = require('gulp-sass'),
 browserSync = require('browser-sync'),
 cleanCSS = require('gulp-clean-css'),
 autoprefixer = require('gulp-autoprefixer'),
 bourbon = require('node-bourbon'),
 ftp = require('vinyl-ftp');

// Update pages on the local server
gulp.task('browser-sync', function() {
browserSync({
 proxy: "opencart",
 notify: false
});
});

// Compile the stylesheet.css
gulp.task('sass', function() {
 return gulp.src('catalog/view/theme/apple/stylesheet/stylesheet.sass')
.pipe(sass({
 includePaths: bourbon.includePaths
 }).on('error', sass.logError))
 .pipe(autoprefixer(['last 15 versions']))
.pipe(cleanCSS())
.pipe(gulp.dest('catalog/view/theme/apple/stylesheet/'))
 .pipe(browserSync.reload({stream: true}))
});

// Monitoring files
gulp.task('watch', ['sass', 'browser-sync'], function() {
 gulp.watch('catalog/view/theme/apple/stylesheet/stylesheet.sass', ['sass']);
 gulp.watch('catalog/view/theme/apple/template/**/*.tpl', browserSync.reload);
 gulp.watch('catalog/view/theme/apple/js/**/*.js', browserSync.reload);
 gulp.watch('catalog/view/theme/apple/libs/**/*', browserSync.reload);
});

// Upload changes to the hosting
gulp.task('deploy', function() {
 var conn = ftp.create({
 host: 'hostname.com',
 user: 'username',
 password: 'userpassword',
 parallel: 10,
 log: gutil.log
});
 var globs = [
'catalog/view/theme/apple/**'
];
 return gulp.src(globs, {buffer: false})
.pipe(conn.dest('/path/to/folder/on/server'));
});

gulp.task('default', ['watch']);
June 10th 19 at 15:32
3 answers
June 10th 19 at 15:34
Solution
Judging by the script was not written by you, let's look at content:
  • the way spelled out in her match with yours?
  • That says a console after launch? (Can't not write...)
  • Open the console in browser and look at the error, what is it?
1) /Applications/MAMP/htdocs/opencart/catalog/view/theme/apple. appeared the stylsheet file.css
2) in console nothing

in the terminal
➜ opencart gulp 
[17:54:59] Using gulpfile /Applications/MAMP/htdocs/opencart/gulpfile.js
[17:54:59] Starting 'sass'...
[17:54:59] Starting 'browser-sync'...
[17:54:59] Finished 'browser-sync' after 153 ms
[17:55:00] Finished 'sass' after 560 ms
[17:55:00] Starting 'watch'...
[17:55:00] Finished 'watch' after 11 ms
[17:55:00] Starting 'default'...
[17:55:00] Finished 'default' after 53 µs
[Browsersync] Proxying: <a href="http://opencart">http://opencart</a>
[Browsersync] Access URLs:
--------------------------------------
 Local: <a href="http://localhost:3000">http://localhost:3000</a>
 External: <a href="http://192.168.1.176:3000">http://192.168.1.176:3000</a>
--------------------------------------
 UI: <a href="http://localhost:3001">http://localhost:3001</a>
 UI External: <a href="http://192.168.1.176:3001">http://192.168.1.176:3001</a>
 --------------------------------------
- Romaine.Stiedemann commented on June 10th 19 at 15:37
June 10th 19 at 15:36
npm run gulp [name Tasca] or gulp [name Tasca], Galp if you have installed "globally"
June 10th 19 at 15:38
By default you have watch runs

Take a gulp browser-sync
did not help (( - Romaine.Stiedemann commented on June 10th 19 at 15:41

Find more questions by tags Gulp.js