Running Deno Install with --entrypoint does not read package.json properly in docker
I am currently deploying deno to lambda using the docker image, I have some npm packages listed in my package.json as I was not getting type suggestions when using them in the deno.json file
the problem now is, whenever I run deno Install --entrypoint main.ts
I get this error for all the dependencies in package.json
but it goes away when I add the package to the deno.json file.
This also works properly without the --entrypoint flag but it installs all the dependencies including devDependencies which is not ideal
6 Replies
Seems it also installs all the dependencies in the package.json file after adding it to the deno.json
If you have package.json you don't need to run with --entrypoint flag
oh, do I need to specify the main file in the package.json?
I had the impression that it used the entry point to know which packages to install or when I start it
somewhere in the docs, it mentiones deno install is required when using package.json
Yes, if you have a package.json then
deno install
is usually prefered
But if you list all your dependencies in that file you can just run deno install
without --entrypoint
You only need --entrypoint
if you want to cache all dependencies from a file that uses npm:
or jsr:
specifiersThe problem without using the entrypoint is I was getting all the dependencies cached, including dev dependencies only needed for deployment
MMM, good point, i thought we had a flag for that
But maybe not