Angular 2:尝试npm启动时出错

时间:2016-08-25 09:16:34

标签: angularjs angular router

这是日志:

node_modules/@angular/router/src/config.d.ts(255,17): error TS1110: Type expected.
node_modules/@angular/router/src/config.d.ts(256,15): error TS1109: Expression expected.
node_modules/@angular/router/src/config.d.ts(257,16): error TS1109: Expression expected.
node_modules/@angular/router/src/config.d.ts(258,12): error TS1109: Expression expected.
node_modules/@angular/router/src/config.d.ts(259,17): error TS1109: Expression expected.
node_modules/@angular/router/src/config.d.ts(260,19): error TS1109: Expression expected.
node_modules/@angular/router/src/config.d.ts(261,10): error TS1109: Expression expected.
node_modules/@angular/router/src/config.d.ts(262,13): error TS1109: Expression expected.
node_modules/@angular/router/src/config.d.ts(263,14): error TS1109: Expression expected.
node_modules/@angular/router/src/config.d.ts(264,1): error TS1128: Declaration or statement expected.

1 个答案:

答案 0 :(得分:0)

我重新安装后出现此错误,此步骤对我有用:

  1. 用以前的版本替换新版本的node_modules文件夹(我保存了备份...)

  2. 运行npm start

  3. 将以前版本的node_modules文件夹替换为新版本。

  4. 之后,npm开始完美地使用新版本。 这似乎是npm的bug ... 我希望这有帮助。