How to go back 1 folder level with __dirname?

TL;DR Use path.join(__dirname, ‘..’, ‘test’, ‘karma.conf.js’). Prevent use of slashes. Long Answer As a lot of answers have pointed out, using path module is probably the best way. However, most of the solutions here have gone back to using slashes like: path.join(__dirname+’../test/karma.conf.js’) However, by doing this, you’re beating the purpose of using path. One uses … Read more

Gulp command not found after install

Turns out that npm was installed in the wrong directory so I had to change the “npm config prefix” by running this code: npm config set prefix /usr/local Then I reinstalled gulp globally (with the -g param) and it worked properly. This article is where I found the solution: http://webbb.be/blog/command-not-found-node-npm

Use gulp to select and move directories and their files

You need to include the base option to src, which will preserve the file structure the way you want: var filesToMove = [ ‘./_locales/**/*.*’, ‘./icons/**/*.*’, ‘./src/page_action/**/*.*’, ‘./manifest.json’ ]; gulp.task(‘move’,[‘clean’], function(){ // the base option sets the relative root for the set of files, // preserving the folder structure gulp.src(filesToMove, { base: ‘./’ }) .pipe(gulp.dest(‘dist’)); }); … Read more

Modify file in place (same dest) using Gulp.js and a globbing pattern

As you suspected, you are making this too complicated. The destination doesn’t need to be dynamic as the globbed path is used for the dest as well. Simply pipe to the same base directory you’re globbing the src from, in this case “sass”: gulp.src(“sass/**/*.scss”) .pipe(sass()) .pipe(gulp.dest(“sass”)); If your files do not have a common base … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)