Table of Contents
Step 1: Open the terminal and enter the following command to install Homebrew
Step 2: Install node, enter the following command in the terminal
Step 3 to view node installation Success or not
Step 1: Create a new file test.js
Step 2: Use the terminal to find it Run in the directory where it is located
Step 3: Access through the browser and return data in json format
Step 4: The front end can parse the data by calling this interface, and can The current page displays data.
Home Backend Development PHP Tutorial Installation and testing of nodejs environment on mac

Installation and testing of nodejs environment on mac

Jul 28, 2016 am 08:27 AM
addclass install node web

A summary

Everyone who has worked as a web server before knows that both nginx+lua and the popular node.js can be used as web servers. The former is more troublesome than the latter in terms of program writing and configuration, but They are all similar in use. Here I suggest that if you don’t know the Lua scripting language, you can learn more about this scripting language. It is known as the scripting language with the highest execution efficiency among all scripting languages. The bottom layer is based on C language, which is very Easy to use, cross-platform!
Next, I will configure the node.js environment for you.

Second configuration of mac node.js environment

Step 1: Open the terminal and enter the following command to install Homebrew

ruby -e “$(curl -fsSL
https://raw.githubusercontent.com/Homebrew/install/master/install);
 mac 上nodejs环境的安装与测试

Step 2: Install node, enter the following command in the terminal

brew install node
 mac 上nodejs环境的安装与测试

Step 3 to view node installation Success or not

node -v
 mac 上nodejs环境的安装与测试

The above three steps node is successfully installed

Three program test

Step 1: Create a new file test.js

 mac 上nodejs环境的安装与测试

Step 2: Use the terminal to find it Run in the directory where it is located

 mac 上nodejs环境的安装与测试
 mac 上nodejs环境的安装与测试

Step 3: Access through the browser and return data in json format

 mac 上nodejs环境的安装与测试

Step 4: The front end can parse the data by calling this interface, and can The current page displays data.

End of three

Isn’t it very simple? If you have done web service interface development before, this should be familiar, and it is even very simple.

').addClass('pre -numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

The above introduces the installation and testing of the nodejs environment on mac, including the relevant aspects. I hope it will be helpful to friends who are interested in PHP tutorials.

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 Article Tags

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)

How to use Nginx web server caddy How to use Nginx web server caddy May 30, 2023 pm 12:19 PM

How to use Nginx web server caddy

Real-time protection against face-blocking barrages on the web (based on machine learning) Real-time protection against face-blocking barrages on the web (based on machine learning) Jun 10, 2023 pm 01:03 PM

Real-time protection against face-blocking barrages on the web (based on machine learning)

How to configure nginx to ensure that the frps server and web share port 80 How to configure nginx to ensure that the frps server and web share port 80 Jun 03, 2023 am 08:19 AM

How to configure nginx to ensure that the frps server and web share port 80

Pi Node Teaching: What is a Pi Node? How to install and set up Pi Node? Pi Node Teaching: What is a Pi Node? How to install and set up Pi Node? Mar 05, 2025 pm 05:57 PM

Pi Node Teaching: What is a Pi Node? How to install and set up Pi Node?

Using Jetty7 for Web server processing in Java API development Using Jetty7 for Web server processing in Java API development Jun 18, 2023 am 10:42 AM

Using Jetty7 for Web server processing in Java API development

How to implement form validation for web applications using Golang How to implement form validation for web applications using Golang Jun 24, 2023 am 09:08 AM

How to implement form validation for web applications using Golang

Token-based authentication with Angular and Node Token-based authentication with Angular and Node Sep 01, 2023 pm 02:01 PM

Token-based authentication with Angular and Node

How to enable administrative access from the cockpit web UI How to enable administrative access from the cockpit web UI Mar 20, 2024 pm 06:56 PM

How to enable administrative access from the cockpit web UI

See all articles