Point memo that was moss when building a docker container created by a colleague

at first

There were some moss points when building the docker container of node created by a colleague, so I will make a note of it. I hope it will be helpful if there are people who fit in the same case!

Premise

__ PC of the person who created the container __ Mac Pro In this environment, if you run docker-compose up --build in one shot, build and up will pass __ My PC __ Windows10 Pro npm --version 6.14.5 Moss several times __ Container configuration __ Node→image: node:latest MySQL→image: mysql:5.7 Nginx→image: nginx:latest

Cannot create container for service mysql: Conflict image.png

It's an error that there is a conflict because there is already a container named mysql. Other nodes and nginx happened as well. I often give the container a name with the default name, so it may be smooth to specify the container name for each project, such as Aservice_mysql or a unique name. The mysql container that already existed was from a project that didn't work anymore, so

docker rm container ID

I deleted __.

npm ERR! enoent ENOENT: no such file or directory, rename '/src/node_modules/constantinople' -> '/src/node_modules/.constantinople.DELETE' I was angry that I couldn't find constantinople. constantinople seems to be a module used for constant evaluation. https://www.npmjs.com/package/constantinople __ I updated the version of npm I'm using to the latest and solved it __. 6.14.5→6.14.8

npm install -g npm

If this doesn't work, it's possible that the contents of the module are simply corrupted during npm install, or that package-lock.json fixes each module with a bad combination of versions. , __Delete all the contents of node_modules __ Delete __package-lock.json and do npm install again __ Please try.

npm ERR! Maximum call stack size exceeded It seems to occur when the maximum call stack size of Node is exceeded. Why doesn't it happen on Mac, but it happens on Windows ... I deleted the cache of __npm __ and rebuilt __ and I was able to start __ without any problems.

npm cache clean --force

Reference: https://www.it-swarm.dev/ja/javascript/npm%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC% E3% 83% AB% E3% 81% A7% E6% 9C% 80% E5% A4% A7% E3% 82% B3% E3% 83% BC% E3% 83% AB% E3% 82% B9% E3% 82% BF% E3% 83% 83% E3% 82% AF% E3% 82% B5% E3% 82% A4% E3% 82% BA% E3% 82% 92% E8% B6% 85% E3% 81% 88% E3% 81% BE% E3% 81% 97% E3% 81% 9F / 829336672 / By the way, if you change the stack size of node, this call stack size problem will be solved temporarily, but It seems safe to stop because Node performance may deteriorate and it may not work at worst. ..

Finally

Docker, which can instantly build the same development environment, has become an indispensable tool for the development scene! It's nice to work on different OS.

Recommended Posts

Point memo that was moss when building a docker container created by a colleague
A memorandum when installing Docker and building a Linux container
A memo that I was addicted to when making batch processing with Spring Boot
A memo when building a Rails 5.2 development environment using Docker Desktop + WSL2 on Windows 10 Home
A memo that handles a class created independently with ArrayList
Docker × Java Building a development environment that is too simple
A story that turbolinks was confused by doing something wrong
[Docker] List of errors that occurred when building the environment
[Memo] Commands used when using Docker (stop container, delete, delete image)
Build a container that automatically formats Docker x Laravel code
I was angry with proc_open (): fork failed when trying to composer update inside a Docker container