DevDavido / performance-audit-plugin

Daily performance audits of all your sites in Matomo.
GNU General Public License v3.0
12 stars 4 forks source link

Plugin activation failing - npm ERR! cause: [Error: EACCES: permission denied, mkdir '/var/www'] #11

Closed angristan closed 4 years ago

angristan commented 4 years ago

Here is the error I get:

screenshot_2020-08-12_21-00-06@2x
PerformanceAudit plugin activation failed due to the following error:
NPM has the following unexpected output: 
npm WARN using --force I sure hope you know what you are doing.
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /var/www
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/var/www'
npm ERR! [OperationalError: EACCES: permission denied, mkdir '/var/www'] {
npm ERR! cause: [Error: EACCES: permission denied, mkdir '/var/www'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/var/www'
npm ERR! },
npm ERR! isOperational: true,
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/var/www'
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! code EACCES
npm ERR! syscall mkdir
npm ERR! path /var/www
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/var/www'
npm ERR! [OperationalError: EACCES: permission denied, mkdir '/var/www'] {
npm ERR! cause: [Error: EACCES: permission denied, mkdir '/var/www'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/var/www'
npm ERR! },
npm ERR! isOperational: true,
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/var/www'
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.

However, my matomo is in /srv/matomo. Not sure what NPM is trying to do here.

Let me know if I can provide more info!

dadall commented 4 years ago

@angristan here are the files/dir NPM is trying to create :

root@b2d:/var/www# tree .npm/ -L 1
.npm/
├── anonymous-cli-metrics.json
├── _cacache
└── _locks

I had to create .npm dir to let the plugin work.

dadall commented 4 years ago

If I may, you'll need chrome/chromium headless as a dep as well.

angristan commented 4 years ago

Turns out I didn't have any /var/www folder 🤔 Simply creating it and giving www-data permissions on it fixed it.

And yes, afterwards I needed some dependencies but the error is self-explanatory. 😄

Thanks @dadall o/