gulp.js - 文件保存上的刷新因错误而终止

时间:2017-06-20 14:29:28

标签: javascript node.js gulp

非常 gulp.js新手。我最近被安排到一个使用gulp超过一年的团队,并要求修复以下问题:当我运行gulp时,它会成功执行并在本地主机上显示正确的内容。在托管Web应用程序时。但是,当我编辑并保存文件时,会导致gulp以错误终止。页面尝试重新加载但失败。在termianl中记录以下错误消息:

Error: EEXIST: file already exists, mkdir 'C:\Users\<user>\flex-force-tools\client
at Error (native)

快速的Google搜索并没有多大用处。我也尝试熟悉gulp功能,但是这个项目比我目前理解的要多得多。

以下是一些可能有用的信息:

Gulpfile.js

'use strict';

var _ = require('lodash')
  , buildConfig = require('./build.config')
  , config = {}
  , gulp = require('gulp')
  , gulpFiles = require('require-dir')('./gulp')
  , path = require('path')
  , $, key;

$ = require('gulp-load-plugins')({
  pattern: [
  'browser-sync',
  'del',
  'gulp-*',
  'karma',
  'main-bower-files',
  'multi-glob',
  'plato',
  'run-sequence',
  'streamqueue',
  'uglify-save-license',
  'wiredep',
  'yargs'
  ]
});

_.merge(config, buildConfig);

config.appFiles = path.join(config.appDir, '**/*');
config.appVersionFile = path.join(config.versionDir, 'VERSION');
config.appFontFiles = path.join(config.appDir, 'common-elements/fonts/**/*');
config.appImageFiles = path.join(config.appDir, 'common-elements/images/**/*');
config.appMarkupFiles = path.join(config.appDir, '**/*.jade');
config.appScriptFiles = path.join(config.appDir, '**/*.js');
config.appStyleFiles = path.join(config.appDir, '**/*.less');

config.buildDirectiveTemplateFiles = path.join(config.buildDir, '**/*directive.tpl.html');
config.buildJsFiles = path.join(config.buildJs, '**/*.js');

config.buildTestDirectiveTemplateFiles = path.join(config.buildTestDir, '**/*directive.tpl.html');
config.buildE2eTestsDir = path.join(config.buildTestDir, 'e2e');
config.buildE2eTests = path.join(config.buildE2eTestsDir, '**/*_test.js');
config.buildTestDirectiveTemplatesDir = path.join(config.buildTestDir, 'templates');
config.buildUnitTestsDir = path.join(config.buildTestDir, config.unitTestDir);
config.buildUnitTestFiles = path.join(config.buildUnitTestsDir, '**/*_test.js');

config.e2eFiles = path.join('e2e', '**/*.js');
config.unitTestFiles = path.join(config.unitTestDir, '**/*_test.js');

for (key in gulpFiles) {
  gulpFiles[key](gulp, $, config);
}

gulp.task('dev', ['build'], function () {
  gulp.start('browserSync');
  gulp.start('watch');
});

gulp.task('deploy', ['build']);

package.json中的Gulp版本

"gulp": "^3.9.1",
"gulp-angular-filesort": "^1.0.4",
"gulp-autoprefixer": "^2.0.0",
"gulp-concat": "^2.3.4",
"gulp-css-rebase-urls": "0.0.5",
"gulp-cssmin": "^0.1.6",
"gulp-eslint": "^1.0.0",
"gulp-filter": "^3.0.0",
"gulp-htmlmin": "^1.0.0",
"gulp-if": "^1.2.4",
"gulp-imagemin": "^2.0.0",
"gulp-inject": "^1.5.0",
"gulp-jade": "^1.0.0",
"gulp-jscs": "^3.0.0",
"gulp-jshint": "^1.8.4",
"gulp-less": "^3.0.1",
"gulp-load-plugins": "^0.10.0",
"gulp-modify-css-urls": "^0.2.0",
"gulp-ng-annotate": "^1.1.0",
"gulp-ng-html2js": "^0.2.0",
"gulp-notify": "^2.1.0",
"gulp-order": "^1.1.1",
"gulp-plumber": "^1.0.0",
"gulp-protractor": "^1.0.0",
"gulp-rename": "^1.2.0",
"gulp-rev": "^5.1.0",
"gulp-sourcemaps": "^1.5.1",
"gulp-template": "^4.0.0",
"gulp-tslint": "^3.1.2",
"gulp-uglify": "^1.0.0",
"gulp-util": "^3.0.8",

环境

我正在64位Windows 7环境中开发。

让我知道你们的想法,或者我是否应该查看其他任何资源。非常感谢!

更新:事实证明,刷新终止了许多不同的错误,所有这些错误都是file already existsfile not found。我认为这肯定意味着没有正确设置命令来重建。有什么建议吗?

0 个答案:

没有答案