node.js - Using Typescript with Nodejs - Can't find index.d.ts -
a friend recommended swap on typescript javascript, way deal problems having implementing promises in loops , conditionals (ts has async/await functionality). can never seem ts compiling properly. latest error got on vscode terminal (which different set of errors getting on console) was:
error ts6053: file 'c:/stuff/node_modules/@types/node/index.d.ts' not found.
so created directory structure , put index.d.ts in there , 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'.
it's not correct way solve problem doing:
created directory structure , put index.d.ts in there
the correct way installing @types/node
npm command in vscode terminal (menu: view > integrated terminal):
npm install @types/node --save-dev
before install it, you'd better delete "@types" folder manually.
Comments
Post a Comment