yarn + ts-node: cannot find module fs

Viewed 38

I have Yarn workspaces with several packages (w1, w2, w3); w3 is using fs library.

I want to use ts-node to run w1 as follows: yarn workspace w1 start where start is node-ts src/index.ts

However I get:

error TS2307: Cannot find module 'fs' or its corresponding type declarations.

This error comes from the w3 workspace; simple compilation tsc in w3 directory works fine.

I tried installing @types/node, which works for tsc, but not for ts-node.

0 Answers
Related