Skip to content
Sign upLog in
← Back to Community
Run With Shell
Profile icon
SilentDragonCod

Is there a way to make it that if you click the run button it will run a command in the shell because I can only run my project with a command in the shell 'npm run dev'. I can't run this command in the console.

Answered by realTronsi [earned 5 cycles]
View Answer
Voters
Profile icon
Soumya-RanjanR9
Profile icon
SilentDragonCod
Comments
hotnewtop
Profile icon
realTronsi

sure, use bash

.replit (configures the run button)

run="bash main.sh"

main.sh

npm run dev # etc

If you want to run commands, use the shell. There should be a default tab called the shell, or open it using ctrl shift s

Profile icon
RYANTADIPARTHI

or you can run the command yourself in the shell.

Profile icon
Wumi4

There is, create a file called .replit, then add this:

run = "npm run dev"

It will run the command npm run dev every time you click the run button.

Or if you want to run a shell command without needed to click the run button, there's already a tab called Shell next to the Console tab. You should see it immediately.

Profile icon
SilentDragonCod

@Wumi4
i dont have a file created .replit, and is it also possible to do it without opening shell? it wont run 24/7 now

Profile icon
Wumi4

@SilentDragonCod
Have you read the first sentence? I say you to create the .replit file, because that file is an optional thing. If you don't know how, on the left of your Repl, there is the file browser, for browsing files of course. At the top of it, you will see a button called Create File or something like that. click on that, then type the name of it, like .replit.

And Wdym at and is it also possible to do it without opening shell? anyway?