似乎必须这样做。我从StackBlitz导出了项目,提取了源,安装了依赖项。 npm start
抛出这样的日志。
> angular-testing-grhfjo@0.0.0 start /home/martin/Downloads/stackoverflow-56258331-angular-form-submit-directive-test
> ng serve
compiler_1.Version is not a constructor
TypeError: compiler_1.Version is not a constructor
at /home/martin/Downloads/stackoverflow-56258331-angular-form-submit-directive-test/node_modules/@angular/compiler-cli/src/version.js:25:23
at /home/martin/Downloads/stackoverflow-56258331-angular-form-submit-directive-test/node_modules/@angular/compiler-cli/src/version.js:10:17
at Object.<anonymous> (/home/martin/Downloads/stackoverflow-56258331-angular-form-submit-directive-test/node_modules/@angular/compiler-cli/src/version.js:16:3)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at /home/martin/Downloads/stackoverflow-56258331-angular-form-submit-directive-test/node_modules/@angular/compiler-cli/index.js:34:21
at /home/martin/Downloads/stackoverflow-56258331-angular-form-submit-directive-test/node_modules/@angular/compiler-cli/index.js:3:17
at Object.<anonymous> (/home/martin/Downloads/stackoverflow-56258331-angular-form-submit-directive-test/node_modules/@angular/compiler-cli/index.js:9:3)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! angular-testing-grhfjo@0.0.0 start: `ng serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-testing-grhfjo@0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/martin/.npm/_logs/2019-05-27T11_18_50_670Z-debug.log
怎么了?