m4rc3l05
m4rc3l05
DDeno
Created by m4rc3l05 on 10/11/2024 in #help
Deno v2 deno install not installing all dep files
Hey, trying to create a docker image using deno v2 where i install dependencies before copying source files like
FROM docker.io/denoland/deno:alpine-2.0.0

RUN mkdir /app
RUN chown -R deno:deno /app

USER deno

WORKDIR /app

COPY --chown=deno:deno deno.json deno.lock .

RUN deno install --node-modules-dir
RUN deno eval "import '@db/sqlite'"

COPY --chown=deno:deno . .

RUN mkdir /app/data
VOLUME [ "/app/data" ]

EXPOSE 4321 4322
FROM docker.io/denoland/deno:alpine-2.0.0

RUN mkdir /app
RUN chown -R deno:deno /app

USER deno

WORKDIR /app

COPY --chown=deno:deno deno.json deno.lock .

RUN deno install --node-modules-dir
RUN deno eval "import '@db/sqlite'"

COPY --chown=deno:deno . .

RUN mkdir /app/data
VOLUME [ "/app/data" ]

EXPOSE 4321 4322
But i am running into a problem when i run the image i get an error:
error: Specifier not found in cache: "https://jsr.io/@hono/hono/4.6.2/src/jsx/jsx-runtime.ts", --cached-only is specified.
at file:///app/src/apps/web/app.tsx:1:1
error: Specifier not found in cache: "https://jsr.io/@hono/hono/4.6.2/src/jsx/jsx-runtime.ts", --cached-only is specified.
at file:///app/src/apps/web/app.tsx:1:1
My deno.json file looks like
{
...
"compilerOptions": {
"jsx": "precompile",
"jsxImportSource": "@hono/hono/jsx"
},
"lock": {
"frozen": true
},
"imports": {
"@hono/hono": "jsr:@hono/hono@4.6.2",
...
}
}
{
...
"compilerOptions": {
"jsx": "precompile",
"jsxImportSource": "@hono/hono/jsx"
},
"lock": {
"frozen": true
},
"imports": {
"@hono/hono": "jsr:@hono/hono@4.6.2",
...
}
}
What could be the issue? i am under the impression that deno install would install all files from all deps
8 replies
DDeno
Created by m4rc3l05 on 9/21/2024 in #help
How to check if stdin is a file?
Hey, how does one check if stdin is a file? in nodejs we could do something like fs.fstatSync(process.stdin.fd).isFile() (example: https://github.com/pinojs/pino-pretty/blob/master/bin.js#L86) which in deno can be translated to Deno.fstatSync(Deno.stdin.rid).isFile. Despite this working for for deno v1, it will not work for deno v2 since both fstatSync and rid will be deprecated, with the first one being deleted entirely. So for deno v2 how can we do this?
20 replies