N
N
narem2022-03-13 14:44:44
gulp.js
narem, 2022-03-13 14:44:44

How to fix Error: EINVAL: invalid argument, mkdir?

All scripts except fonts work fine, but at the fonts moment everything crashes with an error, what could be the problem?
Mistake.

Error: EINVAL: invalid argument, mkdir 'G:\Desktop\High_pass\result\fonts\**'

const path = {
  src: {
    css: 'src/style/**/*.css',
    html: 'src/*.html',
    svg: 'src/images/svg/**/*.svg',
    img: [
      'src/images/**/*.{jpg,jpeg,png}',
      'src/images/*.svg',
    ],
    js: [
        'src/script/components/**/*.js',
        'src/script/main.js',
    ],
    fonts: 'src/fonts/**',
    resources: 'src/resources/**',
  },
  result: {
    css: 'result/style/',
    html: 'result/',
    img: 'result/images/',
    js: 'result/script/',
    fonts: 'result/fonts/**',
  }
};

const fonts = () => {
  return src(path.src.fonts)
    .pipe(dest(path.result.fonts))
}

watch(path.src.fonts, fonts)

exports.default = series(clean, html, resources, svgSprites, images, fonts, scripts, styles, watchFile);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
black1277, 2022-03-13
@black1277

You have the path incorrectly spelled out in the result object - instead of needing without asterisks, you need
fonts: 'result/fonts/**',
fonts: 'result/fonts/',

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question