Home php教程 PHP开发 Graphical tutorial for installing nodejs in Linux environment

Graphical tutorial for installing nodejs in Linux environment

Jan 04, 2017 pm 04:33 PM

1. Download nodejs from the official website and select the one on the left.

Graphical tutorial for installing nodejs in Linux environment

2. Select the file, right-click and click extract here to decompress

Graphical tutorial for installing nodejs in Linux environment

3. Enter the bin directory, right-click and select properties, the decompressed file can be placed anywhere in the system. Copy the path in the location

Graphical tutorial for installing nodejs in Linux environment

Graphical tutorial for installing nodejs in Linux environment

4. Add the path. Enter the .bashrc file and add the path in the location in step three at the end.

Graphical tutorial for installing nodejs in Linux environment

Graphical tutorial for installing nodejs in Linux environment

6. Enter source .bashrc in the terminal, press Enter, and then output the path: echo $PATH to check whether the path has been added successfully.

Graphical tutorial for installing nodejs in Linux environment

#7. Check whether nodejs is successfully installed. Right-click in the js file directory, then click open in terminal, enter the terminal, enter the node file name (the file name was qishuixian.js when I installed it)

consloe.log("1111")

Graphical tutorial for installing nodejs in Linux environment

8. Test in the browser: server.js source code:

var http = require('http'); 
http.createServer(function (request, response) {  
response.writeHead(200, 
 {'Content-Type':'text/html;charset=utf-8'});  
 if(request.url!=="/favicon.ico"){   
console.log('访问');   
 response.write('hello,world');   
response.end('你好,世界'); 
 } 
}).listen(8000); console.log('Server running at http://127.0.0.1:8000/');
Copy after login

Graphical tutorial for installing nodejs in Linux environment

Graphical tutorial for installing nodejs in Linux environment

All of the above This is the graphic tutorial for installing nodejs in the Linux environment introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank you all for your support of the PHP Chinese website!


For more graphic tutorials on nodejs installation in Linux environment, please pay attention to the PHP Chinese website!


Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)