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

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?


Solution 1:

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