I'm currently setting up a Parse Server with AWS EC2 instance, where I've been using Nginx and Elastic IP to manage SSL certificates.
Through different guides I've reached the solution of put the node app at /var/www/parse-server
, but they say I should do 'npm init' in this directory, which is obviously owned by root (and fails because of permissions, of course).
My question is about the proper way of manipulate the app files in this root path, specially because 'sudo npm init' has conflicts with packages when the project keep moving on.
- Should I use 'sudo su' and proceed with the install? I tried to do that, but npm init isn't recognized as a command. I haven't tried with --prefix yet, because I wanted to make sure before do that.
- Should I use another directory to keep my application working? I've though that, but what about Nginx and all the related config?
- Should I chown -R the folder to gain ownership of the
/var/www/parse-server
folder? If I do that, what about permissions later on?
I found two workarounds for this:
Thanks to Davi Macedo for solution 1.