#4632·tools

ENOENT error on `node:18-alpine` container

Author: ZendyLimCreated Jun 29, 2023Updated Aug 14, 2023
LabelsS-To triage

Environment information

block
/home/node/project-tsuki/server/node_modules/rome/bin/rome:37
                throw result.error;
                ^

Error: spawnSync /home/node/project-tsuki/server/node_modules/@rometools/cli-linux-x64/rome ENOENT
    at Object.spawnSync (node:internal/child_process:1110:20)
    at Object.spawnSync (node:child_process:871:24)
    at Object.<anonymous> (/home/node/project-tsuki/server/node_modules/rome/bin/rome:21:42)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:23:47 {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawnSync /home/node/project-tsuki/server/node_modules/@rometools/cli-linux-x64/rome',
  path: '/home/node/project-tsuki/server/node_modules/@rometools/cli-linux-x64/rome',
  spawnargs: [ 'rage' ]
}

Node.js v18.16.1

What happened?

I have this docker and docker-compose configuration for VSCode devcontainer

dockerfile
FROM node:18-alpine

# Install git, openssh and zsh 
RUN apk add --no-cache curl git openssh zsh

# Set user to non-root
USER node

# Install Oh My ZSH and set ZSH as default shell
RUN sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
ENV SHELL=/bin/zsh

# Set working directory
WORKDIR /home/node/project-tsuki/server
services:
  base:
    container_name: project-tsuki-server
    build:
      context: .
      dockerfile: ./Dockerfile
    volumes:
      - ..:/home/node/project-tsuki/server
    command: /bin/sh -c "while sleep 1000; do :; done"   
  1. Run npm i -D rome
  2. Run npx rome init

It exits with error below

/home/node/project-tsuki/server/node_modules/rome/bin/rome:37
                throw result.error;
                ^

Error: spawnSync /home/node/project-tsuki/server/node_modules/@rometools/cli-linux-x64/rome ENOENT
    at Object.spawnSync (node:internal/child_process:1110:20)
    at Object.spawnSync (node:child_process:871:24)
    at Object.<anonymous> (/home/node/project-tsuki/server/node_modules/rome/bin/rome:21:42)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:23:47 {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawnSync /home/node/project-tsuki/server/node_modules/@rometools/cli-linux-x64/rome',
  path: '/home/node/project-tsuki/server/node_modules/@rometools/cli-linux-x64/rome',
  spawnargs: [ 'rage' ]
}

Expected result

Should be success and create a configuration file.

Code of Conduct

  • I agree to follow Rome's Code of Conduct