Click here to Skip to main content
15,917,059 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i just installed node.js and typescript .The >npm vesrion 10.5.0 and node version 20.12.2 while the tyescript is version 17.0.30103.2001.Each time i try to start npm i get the error below


node_modules/@types/cors/index.d.ts(39,52): error TS1005: ',' expected.
node_modules/@types/cors/index.d.ts(45,44): error TS1005: ',' expected.
node_modules/@types/cors/index.d.ts(45,47): error TS1005: ',' expected.
node_modules/@types/node/index.d.ts(20,1): error TS1084: Invalid 'reference' directive syntax.


What I have tried:

npm start

node_modules/@types/cors/index.d.ts(39,52): error TS1005: ',' expected.
node_modules/@types/cors/index.d.ts(45,44): error TS1005: ',' expected.
node_modules/@types/cors/index.d.ts(45,47): error TS1005: ',' expected.
node_modules/@types/node/index.d.ts(20,1): error TS1084: Invalid 'reference' directive syntax.

Please help me
Posted

1 solution

Delete your dist and node_modules folders. Rerun npm install, then rebuild and run. As long as the cors version is right for the version of Angular you are using, that should be all you need to do.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900