Score:0

How to run gnome-terminal -- 'npm run start' without the error 'Permission denied'?

in flag

In a bash script, my command gnome-terminal --working-directory=/path/to/my/working/folder -- 'npm run start' gives me the error Failed to execute child process “npm run start” (Permission denied)

Similar commands such as gnome-terminal --working-directory=/path/to/my/working/folder -- '/some_file.sh' work fine.

Does anyone know a fix?

in flag
How did you install npm? If it was something like `sudo apt install npm`, then the package manager can only run with `sudo` (or by changing a lot of permissions to `777`, which is generally not ideal)
Teresa avatar
in flag
Ah, right. npm came preinstalled on our work laptops, we have no sudo permissions...
Score:1
cn flag

You have an issue with your command syntax. In your command

gnome-terminal --working-directory=/path/to/my/working/folder -- 'npm run start'

gnome-terminal is looking for an executable with the name 'npm run start'. Such executable does not exist on your system.

Remove the quotes, and gnome-terminal will search for the executable npm and pass run and start as arguments.

gnome-terminal --working-directory=/path/to/my/working/folder -- npm run start
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.