npm + Gulp не может найти модуль gulp
У меня проблема с моим проектом angular2-seed. Выполнение "npm install" приводит к следующей ошибке:
throw new TSError(formatDiagnostics(diagnosticList, cwd, ts, lineOffset))
^
TSError: ⨯ Unable to compile TypeScript
Cannot find type definition file for 'node'. (2688)
gulpfile.ts (1,23): Cannot find module 'gulp'. (2307)
gulpfile.ts (2,23): Cannot find module 'gulp-util'. (2307)
gulpfile.ts (3,30): Cannot find module 'run-sequence'. (2307)
gulpfile.ts (5,20): Cannot find module './tools/config'. (2307)
gulpfile.ts (6,47): Cannot find module './tools/utils'. (2307)
Это хорошо работало до того, как я установил npm на чистое репо. Теперь я получаю эту ошибку, и я понятия не имею, что не так. Два дня назад все работало без проблем.
Пожалуйста помоги.
Gulpfile.ts (не изменился со времени последней успешной сборки):
import * as gulp from 'gulp';
import * as util from 'gulp-util';
import * as runSequence from 'run-sequence';
import Config from './tools/config';
import { loadTasks, loadCompositeTasks } from './tools/utils';
loadTasks(Config.SEED_TASKS_DIR);
loadTasks(Config.PROJECT_TASKS_DIR);
loadCompositeTasks(Config.SEED_COMPOSITE_TASKS, Config.PROJECT_COMPOSITE_TASKS);
// --------------
// Clean dev/coverage that will only run once
// this prevents karma watchers from being broken when directories are deleted
let firstRun = true;
gulp.task('clean.once', (done: any) => {
if (firstRun) {
firstRun = false;
runSequence('check.tools', 'clean.dev', 'clean.coverage', done);
} else {
util.log('Skipping clean on rebuild');
done();
}
});
РЕДАКТИРОВАТЬ 1 package.json
{
"name": "angular-seed",
"version": "0.0.0",
"description": "Modular starter project for Angular 2 (and beyond) with statically typed build and AoT compilation",
"repository": {
"url": "https://github.com/mgechev/angular-seed"
},
"scripts": {
"build.dev": "gulp build.dev --color --env-config dev",
"build.dev.watch": "gulp build.dev.watch --color",
"build.e2e": "gulp build.e2e --color",
"build.prod": "gulp build.prod --color --env-config prod --build-type prod",
"build.prod.exp": "gulp build.prod.aot --color --env-config prod --build-type prod",
"build.prod.rollup.aot": "gulp build.prod.rollup.aot --color --env-config prod --build-type prod",
"build.prod.aot": "gulp build.prod.aot --color --env-config prod --build-type prod",
"build.test": "gulp build.test --color",
"test.watch": "gulp test.watch --color",
"generate.manifest": "gulp generate.manifest --color",
"e2e": "protractor",
"e2e.live": "protractor --elementExplorer",
"gulp": "gulp",
"i18n": "ng-xi18n -p src/client/tsconfig.json && gulp clean.i18n",
"lint": "gulp tslint",
"karma": "karma",
"karma.start": "karma start",
"postinstall": "gulp check.versions && gulp build.bundle.rxjs && npm prune && gulp webdriver && gulp print.banner",
"reinstall": "npm cache clean && npm install",
"serve.coverage": "gulp serve.coverage --color",
"serve.dev": "gulp serve.dev --color --env-config dev",
"serve.e2e": "gulp serve.e2e --color",
"serve.prod": "gulp serve.prod --color --env-config prod --build-type prod",
"serve.prod.aot": "gulp serve.prod.aot --color --env-config prod --build-type prod",
"serve.prod.exp": "gulp serve.prod.aot --color --env-config prod --build-type prod",
"serve.prod.rollup.aot": "gulp serve.prod.rollup.aot --color --env-config prod --build-type prod",
"start": "gulp serve.dev --color",
"start.deving": "gulp start.deving --color",
"tasks.list": "gulp --tasks-simple --color",
"test": "gulp test --color",
"e2e.ci": "gulp build.prod --color && gulp build.e2e --color && gulp e2e --color",
"tests.all": "npm test && npm run e2e.ci",
"webdriver-start": "webdriver-manager start",
"webdriver-update": "node_modules/protractor/bin/webdriver-manager update",
"compodoc": "node_modules/.bin/compodoc -p src/client/tsconfig.json",
"serve.compodoc": "node_modules/.bin/compodoc -s"
},
"author": "Minko Gechev <mgechev>",
"license": "MIT",
"devDependencies": {
"@angular/compiler-cli": "^4.0.0",
"@angular/platform-server": "^4.0.0",
"@types/async": "^2.0.32",
"@types/browser-sync": "^0.0.34",
"@types/express": "^4.0.33",
"@types/gulp": "^3.8.32",
"@types/gulp-filter": "^3.0.29",
"@types/gulp-load-plugins": "^0.0.28",
"@types/gulp-protractor": "^1.0.29",
"@types/gulp-sass": "^0.0.29",
"@types/gulp-util": "^3.0.29",
"@types/jasmine": "2.5.41",
"@types/node": "^6.0.45",
"@types/rimraf": "0.0.28",
"@types/run-sequence": "^0.0.28",
"@types/selenium-webdriver": "^2.53.39",
"@types/systemjs": "^0.19.31",
"@types/yargs": "^6.5.0",
"@types/zone.js": "^0.0.27",
"async": "^2.1.1",
"autoprefixer": "^6.5.1",
"browser-sync": "^2.17.3",
"codelyzer": "^2.1.1",
"compodoc": "^0.0.40",
"connect-history-api-fallback": "^1.3.0",
"cssnano": "^3.7.7",
"deep-extend": "^0.4.1",
"event-stream": "^3.3.4",
"express": "~4.14.0",
"express-history-api-fallback": "^2.0.0",
"gulp": "^3.9.1",
"gulp-cached": "^1.1.0",
"gulp-concat": "^2.6.0",
"gulp-concat-css": "^2.3.0",
"gulp-filter": "^4.0.0",
"gulp-inject": "^4.1.0",
"gulp-inline-ng2-template": "^4.0.0",
"gulp-load-plugins": "^1.3.0",
"gulp-plumber": "~1.1.0",
"gulp-postcss": "^6.2.0",
"gulp-progeny": "^0.3.1",
"gulp-protractor": "^3.0.0",
"gulp-rename": "^1.2.2",
"gulp-replace": "^0.5.4",
"gulp-sass": "^3.0.0",
"gulp-sourcemaps": "2.2.0",
"gulp-template": "^4.0.0",
"gulp-tslint": "7.0.1",
"gulp-typescript": "^3.0.2",
"gulp-uglify": "^2.0.0",
"gulp-util": "^3.0.7",
"gulp-watch": "^4.3.10",
"is-ci": "^1.0.9",
"isstream": "^0.1.2",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "^3.0.0",
"karma": "~1.3.0",
"karma-chrome-launcher": "~2.0.0",
"karma-coverage": "^1.1.1",
"karma-firefox-launcher": "^1.0.1",
"karma-jasmine": "~1.1.0",
"karma-mocha-reporter": "^2.2.0",
"karma-remap-istanbul": "^0.2.1",
"merge-stream": "^1.0.0",
"minimatch": "^3.0.3",
"open": "0.0.5",
"protractor": "^4.0.14",
"remap-istanbul": "^0.8.4",
"rimraf": "^2.5.4",
"rollup": "^0.41.4",
"rollup-plugin-commonjs": "^7.0.1",
"rollup-plugin-includepaths": "0.2.1",
"rollup-plugin-node-resolve": "^2.0.0",
"run-sequence": "^1.2.2",
"semver": "^5.3.0",
"serve-static": "^1.11.1",
"slash": "~1.0.0",
"supports-color": "^3.1.2",
"systemjs-builder": "0.15.34",
"tildify": "^1.2.0",
"traceur": "^0.0.111",
"ts-node": "^2.0.0",
"tslint": "^4.3.0",
"typescript": "^2.1.5",
"walk": "^2.3.9",
"yargs": "^6.0.0"
},
"dependencies": {
"@angular/animations": "^4.0.0",
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/core": "^4.0.0",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/router": "^4.0.0",
"@angular/service-worker": "^1.0.0-beta.6",
"angular2-chartjs": "^0.2.0",
"core-js": "^2.4.1",
"intl": "^1.2.5",
"jquery": "1.11.1",
"material-design-lite": "^1.1.3",
"ng2-auto-complete": "^0.12.0",
"ng2-dnd": "2.0.1",
"ngx-uploader": "^2.2.8",
"rxjs": "^5.2.0",
"systemjs": "0.19.41",
"zone.js": "^0.8.4"
}
}