Node.js,npm,express installed in Mac Environment (including Express command not found)

Source: Internet
Author: User

1. Download node. js for Mac

Address: http://nodejs.org/download/

Download the pkg directly, double-click the installation, all the way to next, it is easy to get it done.

The installation will alert you that the path to node and NPM is/usr/local/bin.

See some posts, with homebrew installation is also very easy, I lazy did not try, this way MK under: http://freemem.diandian.com/post/2012-06-02/40028564785.

Currently the latest node. JS installation is complete including NPM, and the test is installed successfully.

You can see version, the installation is successful.

2. Install Express

Using the system current user installation error, prompt "Please try running the This command again as Root/administrator."

Use the sudo command to get root, and you need to enter a password here .

-G is a global installation, if you want to install the specified version you can use sudo npm install-g [email protected] version number.

Install Express again to test if the installation was successful:

The Express command was found to be unrecognized and checked: The XPRESS4 version separates the command line tool Express separately from the Express-generator package and the old version is integrated.

You need to install a command line tool.

3. Create an express project HelloWorld:

4. Run HelloWorld:

Open App.js,

Join:

$ cd helloworld$ NPM install $ node app.js

When installing, if you need root permission again, change $ sudo npm install, OK.

Open Browser input: localhost:8080:

  

Here, the node. JS environment has made birds.

Node.js,npm,express installed in Mac Environment (including Express command not found)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.