aurelia-bundler gulp.js can't be found

aurelia-bundler gulp.js can't be found

本文关键字:be found gulp js can aurelia-bundler      更新时间:2023-09-26

这是我的gulpfile的内容.js:

var gulp = require('gulp');  
var bundler = require('aurelia-bundler');
var config = {  
  force: true,
  packagePath: '.',
  bundles: {
    "dist/app-build": {
      includes: [
        'Main.js',
      ],
      excludes:[
          "gulpfile.js",
      ],
      options: {
        inject: true,
        minify: true
      }
    },
    "dist/aurelia": {
      includes: [
        'aurelia-bootstrapper',
        'aurelia-fetch-client',
        'aurelia-router',
        'aurelia-animator-css',
        'github:aurelia/templating-binding',
        'github:aurelia/templating-resources',
        'github:aurelia/templating-router',
        'github:aurelia/loader-default',
        'github:aurelia/history-browser',
        'github:aurelia/logging-console'
      ],
      options: {
        inject: true,
        minify: true
      }
    }
  }
};
gulp.task('bundle', function() {
    console.log("ok");  
 return bundler.bundle(config);
});

当我运行gulp捆绑包时,发生以下错误:

[08:

08:54] "捆绑包"在 536 毫秒后出错 [08:08:54] 提取 时出错 咕噜.js在 file:///C:/myapp/gulp.js 正在加载gulpfile.js 错误: ENOENT: 没有这样的文件或目录,请打开"C:''myapp''gulp.js" 错误(本机)

我想知道他为什么要在项目的根目录中搜索gulp.js而不是在node_modules文件夹中?

这个文件做的第一件事是尝试要求"gulp" - 你先做了一个npm install吗?

最后我通过删除node_modules文件夹并再次运行 npm install 解决了问题