canary `deno install` - can't find npm modules
deno 2.0.0-rc.1+7bfcb4d
I'm having a deno.json like this
I run
deno install
I have a test like this:
Why can the type declarations not be found? deno install
doesn't seem to make a node_modules folder by default - is that necessary for this this type to be found, or can the import mapping work?
I also have the vitest.config.ts like this:
and when I run the task deno task test
I get an error that "vitest/config" also can't be found:
5 Replies
You're having a syntax error in your
vitest.config.ts
file. A string or import specifier needs to start and end with the same quotation style. If it starts with double quotes it needs to end with double quotes.
Oh, right! So now I get "Error: Cannot find module 'vitest/config'"
Should I setup-up import mapping for that as well next to the one for "vitest"
the types aren't picked up
not sure about the other errors. Just saw the typo in your code before going to bed. Might be worth filing an issue on GitHub for this
And thank you for that - I'd totally missed that
Aha!
Turns out adding the ""nodeModulesDir": "auto"," in the deno.json, and running
deno install
does wonders here.