"no such file or directory, open '/package.json'" when trying to fix federation through Docker

I’m trying to fix federation in my Dockerized PeerTube instance by following this:
https://docs.joinpeertube.org/#/maintain-tools?id=update-hostjs

I’m running this in Docker so I sudo docker exec -it peertube, and then when inside the container, I do NODE_CONFIG_DIR=/app/config NODE_ENV=production npm run reset-password -- -u target_username. The problem is, when I do that, I get this:

npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/package.json'
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-05-22T17_49_41_513Z-debug.log

So it can’t find package.json, but package.json is in /app. How do I get it to see package.json?

The official bug tracker is here: https://github.com/Chocobozzz/PeerTube/issues

Yeah. I just didn’t think it was a bug so didn’t want to clog the issue tracker. I can put it there too I guess.

Hello,

Try

cd /app && NODE_CONFIG_DIR=/config NODE_ENV=production npm run reset-password -- -u target_username

Hey @Chocobozzz. I figured it out on GitHub but forgot to update the situation over here. I just had to do NODE_ENV=production npm run reset-password -- -u target_username instead of NODE_CONFIG_DIR=/app/config NODE_ENV=production npm run reset-password -- -u target_username. Thanks for the help anyway though :smiley:

P.S. It appears I was using the reset password command here by accident. Oops!