rubenochoa's avatar

npm run watch but with ssh shell of Hostgator

Everytime I have to reupload the application so I can make my changes every time I need at .scss file(with laravel mix) running npm run watch . Using ssh shell and connect to the server via CMD. How you can run watch with this way?

pro I installed nvm with no results. That would help me a lot! Thank you.

0 likes
11 replies
LaryAI's avatar
Level 58

You can use the npm run watch command with an SSH shell of Hostgator. To do this, you'll need to install Node.js and npm on the server. You can do this by running the following commands:

# Install Node.js
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs

# Install npm
sudo apt-get install npm

Once Node.js and npm are installed, you can run npm run watch from the SSH shell. This will watch for changes in your .scss files and compile them accordingly.

MohamedTammam's avatar

It's better to run npm run prod to build for production. npm run watch is for development.

What's your issue? you can just log into your server and run npm run prod.

Or you can build in your machine and push to the server with the production build.

webrobert's avatar

Is it shared? Are you saying npm doesn’t work in the production env? My shared host doesn’t allow npm commands. I have to build the side styles and push them via git

MohamedTammam's avatar

@rubenochoa No, I didn't mean that. I meant, is the server shared hosting or a custom server. Anyway for both cases, you should contact Hostgator support and they will install it very quickly.

Please or to participate in this conversation.