I didn't use Telegram API before. However I think you are facing the problem of root permission.
Running from a remote API may not use a root
user (which seems can lead to a vulnerability problem). Then if you execute a command that needs sudo
, it will ask you to input the root password to temporary gain a root privilege. However, if you are using a remote API, you may not have a way to input this root password, which leds you not able to get a root privilege, then you have no permission to run anything related to sudo
.
To solve this, you may use command expect
to automatically send the root password to the process of asking the password. However this may leads to a vulnerability.
A better solution may be changing the privilege (chmod
) of this npm repo, or move it to some place where is more safety and don't need a too high privilege (may use chmod
too).