cd my-lib1yarn linkcd ../my-lib2yarn linkcd ../my-appyarn link "@my-namespace/my-lib1"yarn link "@my-namespace/my-lib2"my-app in Webstorm or PhpStormImports within a linked module are not resolved in the app root node_modules. Instead Webstorm searches them in the linked folder. The same errors happens when using tsc index.ts or using Webpack to compile.
Node, Typescript and Webpack have an option for this: tsc index.ts --preserveSymlinks true
Webstorm should have the same option as Node, TypeScript and Webpack have to preserve symlinks and resolve node_modules like this:
{appDir}
├── app
│ ├── index.js
│ └── node_modules
│ ├── moduleA -> {appDir}/moduleA
│ └── moduleB
│ ├── index.js
│ └── package.json
└── moduleA
├── index.js
└── package.json