mysticatea / npm-run-all

A CLI tool to run multiple npm-scripts in parallel or sequential.
MIT License
5.72k stars 240 forks source link

sh: run-s: not found #220

Closed nsisodiya closed 2 years ago

nsisodiya commented 2 years ago

when I run - npm run build or npm run prebuild, It works perfectly and these scripts use run-s.

But When I am trying to build a docker image, I am getting this error

docker build . --build-arg APP_PORT=3000  -t test1
[+] Building 29.2s (16/16) FINISHED
 => [internal] load metadata for docker.io/library/node:17.2.0-alpine                                                                                                   3.6s
 => [internal] load build context                                                                                                                                       0.3s
 => => transferring context: 1.10MB                                                                                                                                     0.3s
 => [ 5/12] WORKDIR /usr/src/app                                                                                                                                        0.2s
 => [ 6/12] COPY --chown=node:node . /usr/src/app                                                                                                                       0.3s
 => [ 7/12] COPY package*.json ./                                                                                                                                       0.1s
 => [ 8/12] RUN npm ci                                                                                                                                                 23.0s
 => ERROR [12/12] RUN npm run build                                                                                                                                     1.0s
------
 > [12/12] RUN npm run build:
#16 0.940
#16 0.940 > builder-backend@0.0.1 prebuild
#16 0.940 > run-s cleanup prettier lint-check compile
#16 0.940
#16 0.956 sh: run-s: not found
------
executor failed running [/bin/sh -c npm run build]: exit code: 127

It fails on prebuild step. this is the package.json file

cat package.json
{
  ...
  "scripts": {
    "prebuild": "run-s cleanup prettier lint-check compile",
    "build": "nest build",
  },
  "dependencies": {
    ...
  },
  "devDependencies": {
    "npm-run-all": "4.1.5",
  },
}
nsisodiya commented 2 years ago

Problem fixed - npm ci use NODE_ENV to check the environment and was not installing devDependencies.