我从样板模板下载了文件,并尝试运行angular ui。我有如下的package.json
"devDependencies": {
"@angular-devkit/build-angular": "^0.13.3",
"@angular/cli": "^7.1.3",
"@angular/compiler-cli": "^7.2.6",
"@angularclass/hmr": "^2.1.3",
"@types/jasmine": "^3.3.2",
"@types/node": "^10.12.15",
"codelyzer": "^4.0.1",
"jasmine-core": "^3.3.0",
"jasmine-spec-reporter": "^4.2.1",
"karma": "^3.1.4",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^2.0.0",
"karma-coverage-istanbul-reporter": "^2.0.4",
"karma-jasmine": "^2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"nswag": "^12.0.7",
"protractor": "^5.4.2",
"ts-node": "^7.0.1",
"tslint": "^5.7.0",
"typescript": "3.1.6",
"webpack-bundle-analyzer": "^3.0.3"
}
当我运行npm start时,root.module.ts中出现错误
ERROR in ./src/root.module.ts 39:24
Module parse failed: 'import' and 'export' may only appear at the top level (39:24)
You may need an appropriate loader to handle this file type.
| if (shouldLoadLocale()) {
| var angularLocale = convertAbpLocaleToAngularLocale(abp.localization.currentLanguage.name);
> import(`@angular/common/locales/${angularLocale}.js`)
| .then(function (module) {
| registerLocaleData(module.default);
我没有webpack.config.js,但是只有protractor.config.js和karma.config.js 我想我想念什么。
我想念什么?
答案 0 :(得分:0)
遇到了同样的问题。