Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

error Error: Missing api folder. Please create one in your app root directory #322

Open
Rojasking700 opened this issue Dec 28, 2021 · 1 comment

Comments

@Rojasking700
Copy link

i get this error when running on an Azure server.

Container patriotstorm-backend_0_819cdb35 couldn't be started: Logs = 2021-12-28T20:08:19.917920249Z 2021-12-28T20:08:19.917989950Z > @madeinusa/b******@0.1.0 start /usr/src/app 2021-12-28T20:08:19.917998750Z > strapi start 2021-12-28T20:08:19.918003450Z 2021-12-28T20:08:21.588872548Z [2021-12-28T20:08:21.587Z] debug ⛔️ Server wasn't able to start properly. 2021-12-28T20:08:21.590885059Z [2021-12-28T20:08:21.590Z] error Error: Missing api folder. Please create one in your app root directory 2021-12-28T20:08:21.590909859Z at module.exports (/usr/src/app/node_modules/strapi/lib/core/load-apis.js:13:11) 2021-12-28T20:08:21.590916459Z at module.exports (/usr/src/app/node_modules/strapi/lib/core/load-modules.js:25:5) 2021-12-28T20:08:21.590921559Z at Strapi.load (/usr/src/app/node_modules/strapi/lib/Strapi.js:329:27) 2021-12-28T20:08:21.590925959Z at Strapi.start (/usr/src/app/node_modules/strapi/lib/Strapi.js:196:20) 2021-12-28T20:08:21.590940459Z at module.exports (/usr/src/app/node_modules/strapi/lib/commands/start.js:8:33) 2021-12-28T20:08:21.590945759Z at /usr/src/app/node_modules/strapi/bin/strapi.js:50:14 2021-12-28T20:08:21.590950259Z at processTicksAndRejections (internal/process/task_queues.js:95:5) 2021-12-28T20:08:21.607015248Z npm ERR! code ELIFECYCLE 2021-12-28T20:08:21.609638362Z npm ERR! errno 1 2021-12-28T20:08:21.619969919Z npm ERR! @madeinusa/b******@0.1.0 start: strapi start 2021-12-28T20:08:21.620848424Z npm ERR! Exit status 1 2021-12-28T20:08:21.621758929Z npm ERR! 2021-12-28T20:08:21.628099564Z npm ERR! Failed at the @madeinusa/b******@0.1.0 start script. 2021-12-28T20:08:21.628118264Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

here is my docker file
`FROM node:14.17.6-alpine as alpine

Create app directory

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

ARG NODE_ENV
ENV NODE_ENV=${NODE_ENV}
ARG ENVIRONMENT
ENV ENVIRONMENT=${ENVIRONMENT}

Install app dependencies

COPY ./package*.json ./
COPY ./package-lock.json ./
COPY . ./

--build-arg NODE_ENV=production

RUN echo $ENVIRONMENT | base64 -d > .env
RUN cat .env

ENV SHARP_VERSION 0.24.1
RUN npm config set unsafe-perm true
ENV PYTHONUNBUFFERED=1

RUN apk add --update --no-cache g++ make python2 curl tar gtk-doc gobject-introspection expat-dev glib-dev libpng-dev libjpeg-turbo-dev giflib-dev librsvg-dev && ln -sf python2 /usr/bin/python

#Compile Vips and Sharp
RUN apk --no-cache add libpng librsvg libgsf giflib libjpeg-turbo musl
&& apk add libimagequant-dev --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main
&& apk add vips-dev fftw-dev build-base --update-cache --repository https://alpine.global.ssl.fastly.net/alpine/edge/testing/ --repository https://alpine.global.ssl.fastly.net/alpine/edge/main
&& apk --no-cache add --virtual .build-dependencies g++ make python2 curl tar gtk-doc gobject-introspection expat-dev glib-dev libpng-dev libjpeg-turbo-dev giflib-dev librsvg-dev && ln -sf python2 /usr/bin/python

&& su node \

&& npm install sharp@${SHARP_VERSION} --g --production --unsafe-perm \

&& chown node:node /usr/local/lib/node_modules -R \

&& apk del .build-dependencies

RUN python2 -m ensurepip
RUN pip2 install --no-cache --upgrade pip setuptools

RUN npm install
RUN NODE_ENV=$NODE_ENV npm run build

EXPOSE 80 1337/tcp
EXPOSE 80 1337/udp

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

@itancc
Copy link

itancc commented Oct 17, 2022

I have the same problem. How did you solve it

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants