Error when running "npm run build" (non-docker install) #264

Closed
opened 2026-02-04 18:10:59 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @gabrielmajosi on GitHub (Dec 18, 2022).

Upon running npm run build it starts building for a shortwhile but then errors out. This is the resulting log.

root@planka:/var/www/planka/client# npm run build

> build
> react-app-rewired build

Creating an optimized production build...
Failed to compile.

[eslint] Failed to load plugin 'prettier' declared in 'package.json » ../package.json': Cannot find module 'eslint-plugin-prettier'
Require stack:
- /var/www/planka/client/node_modules/react-scripts/config/__placeholder__.js
Referenced from: /var/www/planka/package.json

I am running this on Debian 11 Bullseye, 64 bit, in a container.
NodeJS version 19.2.0

Originally created by @gabrielmajosi on GitHub (Dec 18, 2022). Upon running `npm run build` it starts building for a shortwhile but then errors out. This is the resulting log. ``` root@planka:/var/www/planka/client# npm run build > build > react-app-rewired build Creating an optimized production build... Failed to compile. [eslint] Failed to load plugin 'prettier' declared in 'package.json » ../package.json': Cannot find module 'eslint-plugin-prettier' Require stack: - /var/www/planka/client/node_modules/react-scripts/config/__placeholder__.js Referenced from: /var/www/planka/package.json ``` I am running this on Debian 11 Bullseye, 64 bit, in a container. NodeJS version 19.2.0
Author
Owner

@meltyshev commented on GitHub (Dec 18, 2022):

Hi! Did you run the command npm i at the root of the project? Or you can try to build the client with the command DISABLE_ESLINT_PLUGIN=true npm run build.

@meltyshev commented on GitHub (Dec 18, 2022): Hi! Did you run the command `npm i` at the root of the project? Or you can try to build the client with the command `DISABLE_ESLINT_PLUGIN=true npm run build`.
Author
Owner

@gabrielmajosi commented on GitHub (Dec 26, 2022):

Finally got it working! The instructions on the GitHub readme are incorrect, as you need to run npm install in the root directory, then cd client to run npm run build. Also, copying the client folder is also incorrect as it copies the literal folder and not the contents. I can make a pull request to fix these issues if desired.

@gabrielmajosi commented on GitHub (Dec 26, 2022): Finally got it working! The instructions on the GitHub readme are incorrect, as you need to run `npm install` in the root directory, then `cd client` to run `npm run build`. Also, copying the client folder is also incorrect as it copies the literal folder and not the contents. I can make a pull request to fix these issues if desired.
Author
Owner

@meltyshev commented on GitHub (Dec 29, 2022):

You are right 🙈 It seems npm i stopped working after 5381d45e50.

There are 2 solutions here, either just write that npm i has to be run in the root folder, or as done in the Dockerfile with DISABLE_ESLINT_PLUGIN=true npm run build. In the first case, it will take more space on the server due to the dev dependencies being installed as well. In the second case it's a bit more complicated and strange looking, but it takes less space. Later I'll try to put the whole process into one npm script to build the frontend and copy the necessary files to the server folder (npm i prepare or something like that).

Feel free to make PR with corrections, it will be very welcome 🙏

@meltyshev commented on GitHub (Dec 29, 2022): You are right 🙈 It seems `npm i` stopped working after https://github.com/plankanban/planka/commit/5381d45e5080f91815a5314ff58b8a11979e04cb. There are 2 solutions here, either just write that `npm i` has to be run in the root folder, or as done in the Dockerfile with `DISABLE_ESLINT_PLUGIN=true npm run build`. In the first case, it will take more space on the server due to the dev dependencies being installed as well. In the second case it's a bit more complicated and strange looking, but it takes less space. Later I'll try to put the whole process into one npm script to build the frontend and copy the necessary files to the server folder (`npm i prepare` or something like that). Feel free to make PR with corrections, it will be very welcome 🙏
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/planka#264