inversify / InversifyJS

A powerful and lightweight inversion of control container for JavaScript & Node.js apps powered by TypeScript.
http://inversify.io/
MIT License
11.3k stars 716 forks source link

Inversify: Not compiling after adding "types": ["reflect-metadata"] to tsconfig.json #1066

Open algolee opened 5 years ago

algolee commented 5 years ago

I have installed "inversify" and followed the steps to get started. The steps dictated that I needed to add the following lines to the tsconfig.json file: ... "lib": ["es6"], "types": ["reflect-metadata"], "experimentalDecorators": true, "emitDecoratorMetadata": true ... When types: ["reflect-metadata"] was added to the tsconfig.json file, unit tests no longer compile and my Redux store fails to build with this error:

configureReduxStore.ts(19,7)
      TS2580: Cannot find name '**process**'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.

I have already installed @types/node and the problem continues.

For now i will be removing types: ["reflect-metadata"] from the tsconfig.json file and see what happens. However, any other suggestions will be nice.

tonyhallett commented 5 years ago

when you specify types in tsconfig it affects default type behaviour. You need to add node to types as well. It is described in the typescript documentation