NpmtestingYeoman定制发生器

几天前我已经开始写一个自定义yeoman发生器,我想做一个testing(所以我可以使用travis ECC),但我有一个问题,当我午餐npm test 。 我的生成器只复制4个文件,一个gulpfile.js和3个文件在不同的文件夹,所以最终的结果是:

 Project-folder | |----- gulpfile.js |--------production ---------css/main.css ---------html/index.html ---------js/index.js 

我想testing我的发生器,所以我写这个testing,我开始写它从发电机发电机提供的模板testing

app.js

 'use strict'; var path = require('path'); var assert = require('yeoman-assert'); var helpers = require('yeoman-test'); describe('generator-postcss-template:app', function () { before(function () { return helpers.run(path.join(__dirname, '../generators/app')) .withPrompts({someAnswer: true}) .toPromise(); }); it('creates files', function () { assert.file([ 'production/css/styles.css', 'production/html/index.html' ]); }); }); 

当我午餐npmtesting我有这个错误

 module.js:471 throw err; ^ Error: Cannot find module 'gulp-eslint' at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (module.js:417:25) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object.<anonymous> (/run/media/giulio/Lavoro/Personal/generator-postcss-template/gulpfile.js:4:14) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) npm ERR! Test failed. See above for more details. 

我不知道如何修复它,发电机发电机的testing是相同的,但只检查dummyfile创build和testing通过100%

有人可以帮助我吗?

– 更新 – 删除所有模块并重新安装后,错误被更改为新的错误