简体   繁体   中英

Angular 2: Error when trying to npm start

This is the log:

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.

I Had this error after re-install, this steps help for me:

  1. replace new version of node_modules folder with the previous version (I saved backup...)

  2. run npm start

  3. replace previous version of node_modules folder to the new version.

after that npm start work with new version perfectly. It seems like bug of npm... I hope this help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM