我在Windows 10上使用VSCode,我有一个角度为2的应用程序,与systemjs完美配合。我安装了angular-cli beta 14 webpack版本,并按照升级文档here中的步骤进行操作。
我遇到了很多错误,无法找到Map,Require,Promise等等:这是一个示例:
[默认]中的错误E:\ development \ ketogeniqweb \ node_modules \ @angular \ compiler \ src \ compile_metadata.d.ts:348:14 找不到姓名' Set'。
ERROR in [default] E:\development\ketogeniqweb\node_modules\@angular\compiler\src\directive_normalizer.d.ts:19:99
Cannot find name 'Promise'.
ERROR in [default] E:\development\ketogeniqweb\node_modules\@angular\compiler\src\directive_normalizer.d.ts:21:73
Cannot find name 'Promise'.
ERROR in [default] E:\development\ketogeniqweb\node_modules\@angular\compiler\src\offline_compiler.d.ts:15:25
Cannot find name 'Map'.
的package.json:
{
"name": "migration-project",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"start": "ng serve",
"lint": "tslint \"src/**/*.ts\"",
"test": "ng test",
"pree2e": "webdriver-manager update",
"e2e": "protractor"
},
"private": true,
"dependencies": {
"@angular/common": "2.0.0",
"@angular/compiler": "2.0.0",
"@angular/core": "2.0.0",
"@angular/forms": "2.0.0",
"@angular/http": "2.0.0",
"@angular/platform-browser": "2.0.0",
"@angular/platform-browser-dynamic": "2.0.0",
"@angular/router": "3.0.0",
"bootstrap": "^3.3.7",
"core-js": "^2.4.1",
"es6-shim": "0.35.1",
"font-awesome": "^4.6.3",
"guid": "0.0.12",
"moment": "^2.15.0",
"primeng": "^1.0.0-beta.15",
"primeui": "^4.1.15",
"reflect-metadata": "0.1.3",
"rxjs": "5.0.0-beta.12",
"ts-helpers": "^1.1.1",
"zone.js": "^0.6.23"
},
"devDependencies": {
"@types/core-js": "^0.9.32",
"@types/jasmine": "^2.2.33",
"@types/jquery": "^1.10.31",
"@types/lodash": "^4.14.34",
"@types/node": "^6.0.38",
"@types/source-map": "^0.1.26",
"@types/webpack": "^1.12.34",
"angular-cli": "^1.0.0-beta.14",
"codelyzer": "~0.0.26",
"jasmine-core": "2.4.1",
"jasmine-spec-reporter": "2.5.0",
"karma": "1.2.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.2.1",
"protractor": "4.0.5",
"ts-node": "1.2.1",
"tslint": "3.13.0",
"typescript": "2.0.2"
}
}
tsconfig.json
{
"compileOnSave": false,
"compilerOptions": {
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"mapRoot": "/",
"module": "commonjs",
"moduleResolution": "node",
"noEmitOnError": true,
"noImplicitAny": false,
"outDir": "../dist/",
"rootDir": ".",
"sourceMap": true,
"target": "es5",
"inlineSources": true
},
"files": [
"main.ts",
"typings.d.ts"
],
"types": [
"jasmine",
"jquery",
"lodash",
"node",
"source-map",
"webpack"
],
"exclude": [
"node_modules",
"typings"
]
}
我的项目不会在beta14 cli下构建,我无法弄明白。我在其他程序中发现了很多这方面的报告,但是当我尝试了很多这些修补程序时,这些修补程序显然不适用于此。有人可以指出我需要做些什么才能进行构建
答案 0 :(得分:0)
不确定您是使用Windows还是使用Visual Studio,但人们似乎很难通过这种方式设置... https://github.com/angular/angular-cli/issues/2058