From my reading, npm modules are searched for from current directory and if not found search the parent and repeat this pattern until the specific module is found.
So I have a project with a package.json and I run npm install and then npm run tsc and all is well.
To test the above theory, I move the nod_modules directory to my home directory and run the tsc command again and I get syntax error. Not understanding this issue.
I have attached the package.json file.
../../../../../node_modules/@types/react-select/index.d.ts(18,46): error TS1005: ',' expected.
../../../../../node_modules/@types/react-select/index.d.ts(22,31): error TS1005: ',' expected.
../../../../../node_modules/@types/react-select/index.d.ts(23,27): error TS1005: ',' expected.
../../../../../node_modules/@types/react-select/index.d.ts(24,36): error TS1005: ',' expected.
../../../../../node_modules/@types/react-select/index.d.ts(29,39): error TS1005: ',' expected.
../../../../../node_modules/@types/react-select/index.d.ts(30,39): error TS1005: ',' expected.