Closed zachariahtimothy closed 5 years ago
@zachariahtimothy thanks for using NoDock and creating an issue, try running docker-compose down && docker-compose up --build -d node nginx
from the NoDock folder.
I have not been able to replicate the issue so I'll need a few info from you:
Was there anything in the project folder before you cloned nodock?
Thank you for the reply @philtrep , I think this approach is AMAZING and am really excited to get it working. Using the method you describe, I now get the following errors
npm WARN using --force I sure hope you know what you are doing.
npm WARN checkPermissions Missing write access to /opt/app
npm WARN example-simple-web-node-docker@1.0.0 No repository field.
npm ERR! path /opt/app/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir
npm ERR! Error: EACCES: permission denied, mkdir '/opt/app/node_modules'
npm ERR! { Error: EACCES: permission denied, mkdir '/opt/app/node_modules'
npm ERR! cause:
npm ERR! { Error: EACCES: permission denied, mkdir '/opt/app/node_modules'
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/opt/app/node_modules' },
npm ERR! stack: 'Error: EACCES: permission denied, mkdir \'/opt/app/node_modules\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/opt/app/node_modules',
npm ERR! parent: 'example-simple-web-node-docker' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/www-app/.npm/_logs/2018-02-27T17_49_23_212Z-debug.log
module.js:559
throw err;
^
Error: Cannot find module 'express'
at Function.Module._resolveFilename (module.js:557:15)
at Function.Module._load (module.js:484:25)
at Module.require (module.js:606:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/opt/app/index.js:1:77)
at Module._compile (module.js:662:30)
at Object.Module._extensions..js (module.js:673:10)
at Module.load (module.js:575:32)
at tryModuleLoad (module.js:515:12)
at Function.Module._load (module.js:507:3)
System info:
@zachariahtimothy Okay I see, the problem is that for some reason the user installing the javascript dependencies (www-app
) does not have the permissions required to create the node_modules
folder. It's odd since there is a line in the node Dockerfile that gives full permissions to the executing user on the mounted app folder 🤔
It's not a long-term fix but to allow you to use NoDock for the moment, from your host machine in your project folder run:
mkdir node_modules
chmod -R 777 node_modules
cd nodock/
docker-compose down && docker-compose up --build -d node nginx
If that doesn't work, try purging everything. WARNING: this will destroy every container/image/volume on your machine
docker stop $(docker ps -qa); docker rm -f $(docker ps -qa); docker rmi $(docker images -q); docker volume rm $(docker volume ls -q)
And running.
docker-compose up --build -d node nginx
Let me know if this helps!
@zachariahtimothy Any success? 😄
Hi, I've been having the exact same problem, and I can confirm that the hotfix does work, however, it is not ideal because everytime I clone the repo, that must be done, as the permissions are not correct. By inspecting the Dockerfile and scripts, as well as the logs, I found out that the www-app user has no write access to /opt/app
The line that you referenced chmod 777 /home/www-app -R
gives permissions to the /home/www-app folder as far as I know, however it does not solve the problem as there are no permissions to /opt/app folder. If you could help on this I'd be grateful. :+1:
@imnotteixeira I'll take a look at a permanent fix tomorrow
@philtrep I was able to reproduce @zachariahtimothy 's error and successfully used your patch from Feb to fix it. Do keep us posted about solution.
@imnotteixeira @MJGTwo sorry guys, work has been a lil crazy as of late and my open source contributions have suffered.
I am unable to replicate the error but I'll bet that #109 fixes it.
Let me know how it goes 😄
Has similar error. Fixed with move https://github.com/Osedea/nodock/pull/109/files#diff-fd862f8df18ad438a72182fe51f139d1R19 on 13 line (before if [[ $YARN = true ]]; then
).
I followed the instructions on the home page to try this repo out:
The nginx node comes up fine but the node node fails immediately with the following error
Am I missing or not understanding something here?