node_modules mystery

18 views
Skip to first unread message

Reza Razavipour

unread,
Oct 31, 2017, 7:30:59 PM10/31/17
to nodejs
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.
And the errors are:

 ../../../../../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.



Thoughts?
package.json
Reply all
Reply to author
Forward
0 new messages