Reputation: 603
A friend recommended that I swap over to Typescript from javascript, as a way to deal with the problems I was having implementing promises in loops and conditionals (TS has async/await functionality). I can never seem to get TS compiling properly. The latest error I got on the VSCODE terminal (which is different to the set of errors I was getting on the console) was:
error TS6053: File 'c:/stuff/node_modules/@types/node/index.d.ts' not found.
So I created that directory structure and put index.d.ts in there and now I am getting these errors:
node_modules/@types/node/index.d.ts(6,25): error TS2307: Cannot find module 'stream'.
node_modules/@types/node/index.d.ts(14,32): error TS2304: Cannot find name 'Buffer'.
node_modules/@types/node/index.d.ts(15,78): error TS2304: Cannot find name 'Buffer'.
node_modules/@types/node/index.d.ts(23,39): error TS2304: Cannot find name 'Buffer'.
Upvotes: 1
Views: 2591
Reputation: 1649
it's not a correct way to solve your problem by doing:
created that directory structure and put index.d.ts in there
the correct way is installing @types/node
by npm command in VSCode terminal (MENU: View > Integrated Terminal):
npm install @types/node --save-dev
Before you install it, you'd better delete "@types" folder manually.
Upvotes: 4