angular2 typescript 응용 프로그램을 만들고 있습니다. 더 나은 디자인을 제시하기 위해 angular/material2를 사용하고 있습니다. 프로젝트를 건축하는 것에 관해서 - 나는 꿀꺽 꿀꺽 마시는 것을 사용하고 있습니다.gulp typescript : error TS1005
문제 문 : 나는 @angular/router
에 @angular/router-deprecated
을 변경하고 다음과 같은 오류가 꿀꺽 빌드 작동이 중지 후 다른 패키지 (@angular/core
등 @angular2-material
)
를 업데이트하고 보여주기 위해 강제 :
.../node_modules/@angular2-material/button/button.d.ts(28,14): error TS1005: '=' expected
.../node_modules/@angular2-material/button/button.d.ts(28,22): error TS1005: ';' expected
.../node_modules/@angular2-material/button/button.d.ts(29,14): error TS1005: '=' expected
.../node_modules/@angular2-material/button/button.d.ts(29,28): error TS1005: ';' expected
.../node_modules/@angular2-material/input/input.d.ts(50,14): error TS1005: '=' expected.
.../node_modules/@angular2-material/input/input.d.ts(50,21): error TS1005: ';' expected.
.../node_modules/@angular2-material/input/input.d.ts(51,14): error TS1005: '=' expected.
.../node_modules/@angular2-material/input/input.d.ts(51,19): error TS1005: ';' expected.
내 꿀꺽를 컴파일 코드는 다음과 같습니다 :
const gulp = require('gulp');
const tsc = require('gulp-typescript');
const sourcemaps = require('gulp-sourcemaps');
const tsProject = tsc.createProject('tsconfig.json');
module.exports = function() {
const tsResult = gulp.src('src/**/*.ts')
.pipe(sourcemaps.init())
.pipe(tsc(tsProject));
return tsResult.js
.pipe(sourcemaps.write("."))
.pipe(gulp.dest("dist"));
};
main.ts :
///<reference path="../../typings/index.d.ts"/>
import { bootstrap } from '@angular/platform-browser-dynamic';
import { AppComponent } from './app.component';
import { HTTP_PROVIDERS } from '@angular/http';
bootstrap(AppComponent, [HTTP_PROVIDERS]);
tsconfig.json :
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false,
"outDir": "dist/app"
},
"exclude": [
"node_modules"
]
}
package.json : 깨진 패키지에 문제가 아니면 내가 제대로 뭔가를 구성하지 않은 경우
{
"name": "fallball",
"version": "1.0.0",
"scripts": {
"start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ",
"lite": "lite-server",
"postinstall": "typings install",
"tsc": "tsc",
"tsc:w": "tsc -w",
"typings": "typings"
},
"dependencies": {
"@angular/common": "2.0.0-rc.5",
"@angular/compiler": "2.0.0-rc.5",
"@angular/core": "2.0.0-rc.5",
"@angular/http": "2.0.0-rc.5",
"@angular/platform-browser": "2.0.0-rc.5",
"@angular/platform-browser-dynamic": "2.0.0-rc.5",
"@angular/router": "3.0.0-rc.1",
"@angular/upgrade": "2.0.0-rc.5",
"angular2-in-memory-web-api": "0.0.15",
"core-js": "^2.4.0",
"es6-shim": "^0.35.0",
"@angular2-material/button": "^2.0.0-alpha.7-9",
"@angular2-material/card": "2.0.0-alpha.7-9",
"@angular2-material/core": "^2.0.0-alpha.7-9",
"@angular2-material/toolbar": "^2.0.0-alpha.7-9",
"@angular2-material/input": "2.0.0-alpha.7-9",
"reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6",
"systemjs": "0.19.27",
"zone.js": "^0.6.12",
"bootstrap": "^3.3.6",
"gulp": "^3.9.1"
},
"devDependencies": {
"concurrently": "^2.0.0",
"gulp": "^3.9.1",
"gulp-sourcemaps": "^1.6.0",
"gulp-typescript": "^2.13.6",
"gulp-webserver": "^0.9.1",
"lite-server": "^2.2.0",
"typescript": "^2.0.0",
"typings": "^1.3.1"
}
}
당신이 명확히 주 시겠어요? 고맙습니다!
TypeScript 1.8.10을 사용해 보셨습니까? package.json에서 tsc를 사용할 때도 같은 오류가 발생합니까? – DaSch