Install nodejs to build a ghost personal blog, nodejsghost
Record the process of tossing nodejs in linux today and learn from each other:
(I don't know why I used the source code for installation. When I call npm, The npmlog will always fail to be found. Later I used a binary code for installation. If the ox knows why, hope you can leave a message. Thank you)
Step 1: Download The nodejs binary Library
Wget http://nodejs.org/dist/v0.10.32/node-v0.10.32-linux-x64.tar.gz
Step 2: Download the ghost open source code:
Wget https://ghost.org/zip/ghost-0.5.2.zip
Decompress the files in the nodejs and ghost directories respectively.
Part 3: Install the frameworks and libraries required by nodejs:
./Bin/npm-g install -- production
Part 4: add the js configuration file to node.
1: the cd is redirected to the ghost directory. Otherwise, the packet. json file cannot be found.
2: vim modify the config. js file to set the address and port you want to listen
3: Call nodet in the absolute path to add the configuration js file:
../Nodejs/bin/node config. js
Part 5: Start the nodejs service:
../Nodejs/bin/npm restart
Next, you can enter the URL and port you just set in config. js in the browser.
How to install nodejs in Windows
1. Download The nodejs version (. msi file) in Windows );
2. Double-click the installation;
3. Set environment variables, such:
Path c: \ Program Files (x86) \ nodejs
NODE_PATH C: \ Program Files (x86) \ nodejs \ node_modules
This completes the environment.
How to Build the nodejs server environment?
1. node_modules only stores some dependent packages. The specific database files are stored in the mysql directory.
2. To make the system accessible without opening the editor, you only need to locate the directory of your system in the console and start it with the node command.