Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mgmgpyaesonewin/30d9f825bcb73b060a6d243ec80b8a2b to your computer and use it in GitHub Desktop.
Save mgmgpyaesonewin/30d9f825bcb73b060a6d243ec80b8a2b to your computer and use it in GitHub Desktop.
sudo chown -R $USER /var/www/crawler/
ubuntu@ip-172-31-32-251:/var/www/crawler$ npm install
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /var/www/crawler/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/var/www/crawler/node_modules'
npm ERR! [Error: EACCES: permission denied, mkdir '/var/www/crawler/node_modules'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/var/www/crawler/node_modules'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in: /home/ubuntu/.npm/_logs/2024-03-12T17_23_26_238Z-debug-0.log
ubuntu@ip-172-31-32-251:/var/www/crawler$ sudo chown -R $USER /var/www/crawler/
ubuntu@ip-172-31-32-251:/var/www/crawler$ npm install
@mgmgpyaesonewin
Copy link
Author

pm2 start npm --name crawler -- run start -- -p 3000

@mgmgpyaesonewin
Copy link
Author

server {

server_name crawler.bethesdamedical.co;

charset utf-8;

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt  { access_log off; log_not_found off; }

error_log /var/log/nginx/error.log;

location / {
    proxy_pass http://localhost:3000;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
}

}

@mgmgpyaesonewin
Copy link
Author

sudo chown -R www-data.www-data /var/www/api/storage
sudo chown -R www-data.www-data /var/www/travellist/bootstrap/cache

@mgmgpyaesonewin
Copy link
Author

sudo chown -R $USER /var/www/api

@mgmgpyaesonewin
Copy link
Author

346 sudo nginx -t
347 sudo systemctl restart nginx
348 sudo systemctl status nginx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment