Confused by deno vendor-related behaviors
I created a main.ts containing this code:
I ran this command:
No
vendor/
directory was created, but it generated the following:
I created a deno.json:
I then tried to run main.ts:
1 Reply
I am confused on two points:
1 - Why the error occurs, (but that may be my test code being bad).
2 - Why does deno try to access
node_modules
in all these directories? I only want it to access (and only try to access) the one in the current directory.
I guess while I am posing questions, I'll also ask if this is the correct/best way to achieve the goal of being able to include needed modules without downloading them remotely?
Ok, I think I found my answer to 1 - The example I was following left off the options parameter for the createConnection function.
I still have no idea about 2, though.
Ok, this behavior of searching all the directories is apparently modeled after node's module resolution algorithm, so it is not a bug.
Using deno run --deny-read=../
seems to stop the behavior, though. I'm not sure why --deny-read=../
doesn't prevent reading ./
, but it doesn't seem to do so, so this works to solve this problem for now.