You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using vite with vite-plugin-checker causes it to invoke Node, and the build fails:
/usr/bin/env: 'node': No such file or directory
Normally Deno is supposed to override calls to node to deno, but it's failing to do so here.
Here is a reproduction Dockerfile:
FROM denoland/deno:2.0.5
WORKDIR /app
RUN deno run -A npm:create-vite@latest -t react-ts .
RUN deno install
RUN deno add npm:vite-plugin-checker
RUN cat <<EOF > vite.config.ts
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import checker from 'vite-plugin-checker'
export default defineConfig({
plugins: [react(), checker({ typescript: true })],
})
EOF
RUN deno run -A npm:vite build
The dockerfile does not build:
➜ vite-deno-repro docker build -t yolo .
[+] Building 1.9s (10/10) FINISHED docker:default
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 461B 0.0s
=> [internal] load metadata for docker.io/denoland/deno:2.0.5 0.2s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [1/7] FROM docker.io/denoland/deno:2.0.5@sha256:508bb46f0bb996c60498ddf094324078f05021b08854a3e308dcc1d5a3e36b38 0.0s
=> CACHED [2/7] WORKDIR /app 0.0s
=> CACHED [3/7] RUN deno run -A npm:create-vite@latest -t react-ts . 0.0s
=> CACHED [4/7] RUN deno install 0.0s
=> CACHED [5/7] RUN deno add npm:vite-plugin-checker 0.0s
=> CACHED [6/7] RUN cat <<EOF > vite.config.ts 0.0s
=> ERROR [7/7] RUN deno run -A npm:vite build 1.7s
------
> [7/7] RUN deno run -A npm:vite build:
1.526 vite v5.4.10 building for production...
1.604 /usr/bin/env: 'node': No such file or directory
------
Dockerfile:20
--------------------
18 | EOF
19 |
20 | >>> RUN deno run -A npm:vite build
21 |
--------------------
ERROR: failed to solve: process "/bin/sh -c deno run -A npm:vite build" did not complete successfully: exit code: 127
The text was updated successfully, but these errors were encountered:
I think this was caused by npm lifecycle scripts.
I'm facing the same issue while executing the docker production build.
In Dockerfile:
FROM denoland/deno:debian-2.0.3
...
RUN deno install --allow-scripts=npm:[email protected]
Error:
3.345 error: script 'install'in'[email protected]' failed with exit code 1
3.345 stderr:
3.345 /usr/bin/env: 'node': No such file or directory
How to execute npm lifecycle scripts if there is no NodeJs runtime in the Deno docker image? Is there any way to execute npm lifecycle scripts using Deno runtime? Or did I miss something? Any help is much appreciated.
Version: Deno 2.0.5
Using vite with
vite-plugin-checker
causes it to invoke Node, and the build fails:Normally Deno is supposed to override calls to
node
todeno
, but it's failing to do so here.Here is a reproduction Dockerfile:
The dockerfile does not build:
The text was updated successfully, but these errors were encountered: