How to run "Grunt serve" command on live hosting? - angularjs

I have made one angular app. this app in use grunt and run application using "Grunt Serve" command. But, I have uploads this application on live hosting. so, please help me... How to run "Grunt serve" command on live hosting?

Achieve that by following steps:
Make sure node.js is installed on hosting instance
Make sure you app has proper package.json that contains grunt
dependencies used by your app
Connect to host machine and run npm install (via putty or ssh or
....)
After packages are installed you can run grunt serve manually or you
can put that command in postinstall script of package.json to auto
run after npm install is done

Related

React server is not running through npm start

Good Evening I am doing a project in ReactJs through npm start project is compiling but has not started, loading for several minutes via localhost 3000 on google chrome. what should I do now?
Try to install Yarn using yarn install after that run following command
yarn start

Can't run mlflow standalone react server

I need to run the frontend UI on a separate server as a stand-alone react app (not with all of the mlflow python server and packages). But when I run the production build, I get the following error:
You need to enable JavaScript to run this app.
Reproduce:
git clone https://github.com/mlflow/mlflow.git
cd mlflow/mlflow/server/js
In development mode, "npm start" it works just fine:
npm install
npm start
But when I've run it in production, I am getting the above error.
npm install
npm install -g serve
npm run build
serve -s build
I tried many things searching in forums, including this one:
I am getting error in console "You need to enable JavaScript to run this app." reactjs.
but I didn't manage to make it work.

How to run production build locally using webpack server?

I am using webpack-dev-server locally to build my application. I have configure it properly and on running command "yarn build" its generating files into /dist/ folder.
Is there any way I can use the dist folder locally using the webpack-dev-server? The idea is I need to run multiple versions of my application locally to test few stuf.
You need a server to serve your generated dist folder.
You can use (https://www.npmjs.com/package/http-server):
npm install -g http-server
Jump into your dist folder and run:
http-server

Angularjs Project run localmachine

I wanna run this project using Node.js. I have already installed it. But I don't know how to run it in my local system. Any help is appriciated.
install a simple http-server by following command
npm install -g http-server
go to project main folder where index.html exists and run command
http-server
You can start your project at locathost:8080

gh-pages failing while trying to deploy Reactjs app to GitHub in windows 10

I tried following the exact instructions listed in the react documentation on how to deploy a working app to github pages. When I ran npm run deploy. It kept failing at the gh-pages -d build saying that the 'gh-pages' is not an internal or external command. I made sure I had the latest versions of node and npm installed
I had installed gh-pages using the -g tag to make it globally available. Tried adding to the system path variable leading to the node modules folder where i knew gh-pages was loaded. Still nothing.
Finally i tried running it from the git bash window instead of the cmd terminal. This hadn't occurred to me at first as all of the other npm commands worked. Don't know why this fixed things but it did. Just posting this so somebody else might be spared the pain
I had the same issue but finally managed to make it work. The main issue was that I hadn't installed Git for Windows, but I took some extra steps to make sure everything works fine.
Download and install Git for Windows from here
Run npm cache clean to clean npm cache
Run npm install npm#latest -g to install the latest version of npm
Add "homepage" : "http://myname.github.io/myapp", to
"package.json" file and replace the URL with correct GitHub pages URL. If you are not sure about the URL, open the project repository in the browser and go to "Settings" tab. Scroll down and find correct URL under "GitHub Pages".
Run npm install --save-dev gh-pages to install gh-pages module
Add the following 2 lines to "scripts" object in "package.json" file:
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
Finally, run npm run deploy to create an optimized production
build and deploy it on GitHub pages. If you haven't logged in to
Github for windows app before, Github app pops up and asks you to enter your username and password. When you've done that the deploy process will continue and uploads the production build on GitHub pages.
Hope that helps, happy coding.
If it says this, then node_modules/.bin/gh-pages doesn't exist (no, you don't need to install it globally). If it doesn't exist, then it means you either forgot to run npm install --save-dev gh-pages, or something went wrong during the installation.
I would not recommend installing it globally (although looks like it worked in your case).

Resources