#Running Deno Install with --entrypoint does not read package.json properly in docker

10 messages · Page 1 of 1 (latest)

dire mauve
#

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

Relative import path "zod" not prefixed with / or ./ or ../ and not in import map from "file:///var/task/main.ts"

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

dire mauve
#

Seems it also installs all the dependencies in the package.json file after adding it to the deno.json

azure lantern
#

If you have package.json you don't need to run with --entrypoint flag

dire mauve
#

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

azure lantern
#

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: specifiers

dire mauve
#

The problem without using the entrypoint is I was getting all the dependencies cached, including dev dependencies only needed for deployment

azure lantern
#

MMM, good point, i thought we had a flag for that