I have already built a few VueJs applications for myself. Now I am working with a team. One backend and me frontend.
Now I'm wondering how do I include the environment in the repository. Until today I always had node on my local machine. With nvm I could also jump between versions on the local machine. But now I want future colleagues who will develop the app to have the same environment. So work with the same node and npm version. I thought this could be done with a dockerfile or docker-compose.yml. Then I can log into the container and run the npm run build for example.
Question But how does it work with npm run dev? Do I have access with the browser to the port that is assigned in the container of the Vue app?
Related
I'm currently using NextJS and to run a production build, I use npm run build followed by npm run start. This all works well on my local machine.
However, I need to deploy this app on an offline machine where I may not have an internet connection to install all the node packages.
I've taken a look at npm pkg and npm pack utilities, but not quite sure which is the best one to use in the context of a nextjs app.
Would appreciate any advice on the best way to do this.
Edit: thinking along the lines of how I would build my maven project and have a .jar output which I can use to deploy to any other machine as a single deployable file.
I'm using the Fluid draft-js example here:
https://github.com/microsoft/FluidExamples/tree/main/draft-js
I know I can run the app locally by just running npm start or just the server by using npm start:server
But how can I deploy this app (server) to a production environment? (I'm sorry if this is a stupid question). Should I just upload the repository to a node environment and run the commands? Should I try to make a docker image?
Any ideas?
I am very very new to React JS and have tried to install it on my VPS server that is running Cent OS.
Node.js seems to be working,
I have build a React project using the following code as a root level user on SSH:
npx create-react-app my-react-project
cd my-react-project
npm start
but when trying to view in browser I get a blank page (instead of react js default template)?
I see many people install this locally but I haven't found any examples on a hosted VPS, is this something I am doing wrong?
Any help would be much appreciated, thanks!
if you have ssh access to your VPS, the rest is pretty the same as your local environment.
You can copy/paste your project to your CentOS host and use the following commands in order to run it:
cd your_project_folder_which_includes_package_json_file
npm install
npm start
Also, if you are using this server as a production host, You should consider getting a production build of your React app on your local env by running npm run build and then publishing the build folder on your server and serving it using a static file server or using a reverse-proxy such as Nginx as a static server.
Actually this page in React documentation does a good job in explaining the details of deploying a React app, I encourage you to take a look at it.
I have developed my application on a windows machine and have to deploy this on a standalone UNIX server and while running commands like: npm start, it says that package is not available but I checked and everything is available in the project's npm modules.
Do I need to use docker or how can I achieve that without any container such as docker or kubernete.
Can I try cloning my repo in some other Linux machine and npm install and then use the same folder to deploy on UNIX CentOS running on the server?
Normally in local, I use cmd, command line to install any nodejs module using "npm install testing or connect or etc.."
But I decided to use appfog as server and I add nodejs to my project on appfg but probably I am gonna need some nodejs modules like testing, connect, request etc..
The problem is I couldnt found tool like cmd on appfog or any way to add nodejs modules.
How can I do this?
Basically, you just need to install the dependencies in your local environment and everything should be just fine. Simply specify all of your dependencies in your package.json file, run a typical npm install, and if the modules are properly installed in your local environment then they will be pushed to AppFog when you run af update.
You just have to develop your application on your local machine with all the required dependencies in the json package and modules in the Node.JS. And if your application is working properly at that time on your local machine then you can push all that application data to the AppFog using command line interface. Simply use the command af update <your app name> Then start the application and you will see that everything is working properly.