M
M
Maxim2020-07-14 00:48:06
Docker
Maxim, 2020-07-14 00:48:06

Docker + nuxt.js installation?

Created a Dockerfile

FROM node:14.5.0
ENV APP_ROOT /

ENV NODE_ENV production

WORKDIR ${APP_ROOT}
ADD . ${APP_ROOT}

RUN npm ci
RUN npm run build

CMD ["npm", "run", "start"]

and package.json file

{
  "name": "lsf",
  "config": {
    "nuxt": {
      "host": "0.0.0.0",
      "port": "3000"
    }
   },
  "scripts": {
    "dev": "nuxt"
  }
}

I run the command

docker build -t extrememod/lsf .
it gives errors

Sending build context to Docker daemon  10.24kB
Step 1/8 : FROM node:14.5.0
 ---> 37ad18cd8bd1
Step 2/8 : ENV APP_ROOT /
 ---> Using cache
 ---> 24eafde3e37f
Step 3/8 : ENV NODE_ENV production
 ---> Using cache
 ---> 7fcbe82b387a
Step 4/8 : WORKDIR ${APP_ROOT}
 ---> Using cache
 ---> c74f25b1e544
Step 5/8 : ADD . ${APP_ROOT}
 ---> 82eee2797f8d
Step 6/8 : RUN npm ci
 ---> Running in 1b63010d1b38
npm ERR! cipm can only install packages with an existing package-lock.json or npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with [email protected] or later to generate it, then try again.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-07-13T21_26_05_159Z-debug.log
The command '/bin/sh -c npm ci' returned a non-zero code: 1

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Shumov, 2020-07-14
@inoise

cipm can only install packages with an existing package-lock.json or npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with [email protected] or later to generate it, then try again.

and
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-07-13T21_26_05_159Z-debug.log

doesn't help at all, does it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question