简体   繁体   中英

Gulp Rename illegal operation

My gulp file looks like:

function aureliaJsonPath(name) {
    return `./aurelia_project/aurelia.${name}.json`;
}

gulp.task('use-login-au-json', () => {
    return gulp.src(aureliaJsonPath('login'))
        .pipe(rename('aurelia.json'))
        .pipe(gulp.dest('./aurelia_project'));
});

[11:59:18] Error: EISDIR: illegal operation on a directory, open '... base directory...\\aurelia_project\\aurelia.json'

Basically, I have a directory with aurelia.login.json which I want to copy and rename to aurelia.json in the same directory.

The problem here was because in previous tests I had accidentally created a directory called aurelia.json inside the directory I was trying to create the file aurelia.json

After deleting that directory it then worked perfectly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM