问题描述
我刚刚将Gojs包含在当前的角度项目中。
我遵循的步骤
npm install gojs --save
在我的应用程序组件中,我刚刚导入了gojs
import * as go from 'gojs';
之后,当我运行ng服务/构建时,我遇到了以下错误。
RROR in node_modules/gojs/release/go.d.ts(14239,27): error TS1005: ')' expected.
node_modules/gojs/release/go.d.ts(14239,45): error TS1005: ',' expected.
node_modules/gojs/release/go.d.ts(14239,68): error TS1005: ',' expected.
node_modules/gojs/release/go.d.ts(14240,16): error TS1005: ',' expected.
node_modules/gojs/release/go.d.ts(14240,38): error TS1005: ',' expected.
node_modules/gojs/release/go.d.ts(14241,43): error TS1005: ',' expected.
node_modules/gojs/release/go.d.ts(14242,5): error TS1138: Parameter declaration expected.
node_modules/gojs/release/go.d.ts(14242,7): error TS1128: Declaration or statement expected.
node_modules/gojs/release/go.d.ts(14242,11): error TS1128: Declaration or statement expected.
node_modules/gojs/release/go.d.ts(14242,12): error TS1128: Declaration or statement expected.
node_modules/gojs/release/go.d.ts(14242,14):
Pacakage.json
"@angular/cli": "~6.0.3",
"@angular/compiler-cli": "~6.0.2",
"@angular/language-service": "~6.0.2",
"@types/jasmine": "~2.8.6",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.2.1",
"gulp": "^4.0.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "^3.1.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~1.4.2",
"karma-jasmine": "~1.1.1",
"karma-jasmine-html-reporter": "~0.2.2",
"minimist": "~1.2.0",
"ng-packagr": "~3.0.0-rc.2",
"protractor": "^5.4.1",
"ts-node": "~5.0.1",
"tsickle": ">=0.25.5",
"tslib": "~1.7.1",
"tslint": "~5.9.1",
"typescript": "^2.7.2"
1楼
Ofir Lana
3
2019-02-21 14:49:51
您需要升级TypeScript版本。
go.d.ts文件需要v2.8。
要升级当前的TypeScript Verison,请执行以下操作: npm install -g typescript@latest
。
2楼
Overflowrun
0
已采纳
2019-02-25 06:51:39
谢谢@walter Northwoods,
我刚刚将GOJS 2. *降级为1.8 *
npm install gojs@1.8.34
解决了问题。