I have a VM running Ubuntu Server 20.04LTS and I want to run a nodejs program using PM2. I'm having problems to install pm2 npm install -g pm2@latest
and sudo npm install -g pm2@latest
.
npm ERR! code ENOENT
npm ERR! syscall chmod
npm ERR! path /usr/lib/node_modules/pm2/node_modules/mocha/node_modules/mkdirp/bin/cmd.js
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/lib/node_modules/pm2/node_modules/mocha/node_modules/mkdirp/bin/cmd.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-06-04T18_01_48_656Z-debug.log
Ps: I tried npm install -g npm@latest
and cleaning npm cache but nothing seems to work. The error says that this file doesn't exist but despite knowing that, I don't know what I can do or what is causing the problem. I don't know if this affects something but I'm on root mode