How do I install NPM packages as *development dependencies* in Deno? Is that even possible?
Hello!
I am starting a new project and I am using Drizzle. I have installed dependencies as
deno add npm:drizzle-orm
, but I also need the following command npm i -D drizzle-kit tsx
to install drizzle-kit
as a dev dependency, how do I achieve this in Deno?3 Replies
I might have figured it out, but I am not sure.
I found in the docs that there are the
--dev
and -D
options, but I don't know if I used it correctly. I used the following command:
deno add -D npm:drizzle-kit
and it did install the package, however, in deno.json
, the package is shown under imports
along with all other installed packages... so my question is, how do I know whether it was installed as a dev dependency?
Here are the sections of the documentation page I consulted:
- https://docs.deno.com/runtime/reference/cli/install/#options-dev
- https://docs.deno.com/runtime/reference/cli/install/#examples--dev
has no effect without a package.json. Dependencies inside of a deno.json imports field are "smart", and are only installed when needed - there is no need to make an explicit distinction between production and development dependencies.Wow! I had no idea, that's great! Thank you very much for your help! :deno_thankyou: