I installed pm2 with NPM without the global flag. Then I started de index scrpit with "npm start" thath declared on package.json as
"start": "pm2 start index.js"
How con I stop it?
>Solution :
You can access locally-installed pm2 with npx:
$ npx pm2 list
$ npx stop 0 # first app will have ID=0
But in general, I would manage it by attaching a name to the app. Let’s edit your package.json:
"start": "pm2 start index.js --name my-app"
"stop": "pm2 stop my-app",
"logs": "pm2 logs my-app"
And then:
$ npm run start
$ npm run logs
$ npm run stop