forumone / nextjs-project

Next.js project template
0 stars 0 forks source link

Fix EACCES error when trying to install pm2 with ddev #115

Closed kmonahan closed 4 weeks ago

kmonahan commented 1 month ago

On ddev 1.23.1 and Docker for Mac 4.30.0, was getting the error:

npm error code EACCES
npm error syscall mkdir
npm error path /usr/local/lib/node_modules/pm2
npm error errno -13
npm error [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/pm2'] {
npm error   errno: -13,
npm error   code: 'EACCES',
npm error   syscall: 'mkdir',
npm error   path: '/usr/local/lib/node_modules/pm2'
npm error }
npm error

on start-up. pm2 could not be installed via a post-start hook. Moving the installion to an extra Dockerfile, as described in https://ddev.readthedocs.io/en/stable/users/extend/customizing-images/#adding-extra-dockerfiles-for-webimage-and-dbimage, fixed the issue.

Also removes some deprecated options no longer allowed by the schema while we're at it.

klatovak commented 4 weeks ago

@kmonahan We can also remove the version property from .ddev/docker-compose.overrider.yaml, which I believe became obsolete with 1.23.0. Should we consider doing that here as well or in a separate PR? Otherwise, this fixes the EACCES issue for me.

kmonahan commented 4 weeks ago

@klatovak Good call; yeah, makes sense to just go ahead and remove that here while I'm at it.