I made simple chat application with node.js and socket.io It's working in localhost:3000
But, I want to put it on my own website. I don't know how to install node.js package on web server. I am having mac.
Do you have any idea, how to do it?
js application locally after closing the terminal or Application, to run the nodeJS application permanently. We use NPM modules such as forever or PM2 to ensure that a given script runs continuously. NPM is a Default Package manager for Node.
You can run the Node. js application directly from shell, however in order to make sure that it survives server restarts and potential crashes, it should be installed as a service.
Install the http-server globally on your machine using the node package manager (npm) command line tool, this will allow you to run a web server from anywhere on your computer.
Yes. Modules are cached on first require, if you use a module that gets updated when running npm install , the running process will keep using the cached version.
Grab the tarball from http://nodejs.org/download/, untar it tar -xzf
to some directory, and then run it.
Or use a package manager as described here.
So as an example assuming you grabbed the latest 64-bit vers...
# go to a location where you'll install node
mkdir -p /app/nodejs
cd /app/nodejs
tar -xzf /path/to/node-v0.10.21-linux-x64.tar.gz
At this point, nodejs is in /app/nodejs/node-v0.10.21-linux-x64
Add the bin directory to your PATH
(you can edit your ~/.bash_profile
or some other init script - for now this will just be for the shell session:
export PATH=$PATH:/app/nodejs/node-v0.10.21-linux-x64/bin`
Now you should be able to do npm install and the like. It sounds like you may need to familiarize yourself with Linux basics - everyone needs to learn somewhere/sometime - I suggest you google around for a good tutorial that suits you.
http://nodejs.org/download/ Go there. Download it. Put the downloaded folder somewhere near your web pages and just reference it on your page.
You will reference on your page with something like this but instead of https link to google it will be a file path to where the folder is
Where the squiggle is could be different depending on where you place that folder. You shouldn't have to run any commands on it after it is downloaded
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With