Mac OS (10.13.6) installed Node.js

  1. Download the installation package

    Download:https://nodejs.org/en/
     


     
  2. installation

    pkg double-clicking the file, the next, the installation is complete
     


     
  3. Verify that the installation was successful

    Terminal opened, the input node -v, and then return, then enter npm -v, Enter

    if the version information is returned, it indicates that the installation was successful
     


     
  4. The first project helloworld node.js

    New helloworld.js file finder in the user directory, the following code tie
     

    const http = require('http');

    const hostname = '127.0.0.1';

    const port = 1337;

    http.createServer((req, res) => {

    res.writeHead(200, { 'Content-Type': 'text/plain' });

    res.end('Hello World\n');

    }).listen(port, hostname, () => {

    console.log(`Server running at http://${hostname}:${port}/`);

    });

    save, open Terminal, to start using the service node helloworld.js

     


    your browser to http://127.0.0.1:1337

     

     

Intelligent Recommendation

Mac installed at node.js, Ionic

Access node.jsOfficial website(Https://nodejs.org/en/download/), download the appropriate version. Downloading, click on the install directory [default] Node.js v8.9.3 to /usr/local/bin/node  npm...

Mac installed node.js and configure

Article catalog First, download node.js installation package Second, install node.js Third, configure global modules and cache paths Fourth, configure Ali mirror V. Test, globally installed TypeScript...

Mac OS 10.12.5 Install Node.js

Because many open source plugins are now available to provide independent web applications, you can directly modify the configuration file directly, often need to use the Node.js environment, which me...

Vagrant installed under Mac OS

Vagrant is a tool for building virtual development environment, it is actually regarded as a virtual machine management tool for cross-platform 1 Installation 1.1 Installation Vagrant After downloadin...

Redis installed under Mac OS

Redis installed under Mac OS Front-end learning the whole stack to learn to Redis, so now to the local computer installation Redis. No problem, and then on my CentOS deployment, step by step, and now ...

More Recommendation

Mac OS X is installed brew

brew is in a super-mac installation tool, he can not install a lot of tools mac, e.g. automake, autoconfig, hg, git, curl, wget command tools, etc., and their function aptg-get under Linux and similar...

Finally installed the Mac OS virtual machine in VirtualBox! (

Finally installed the Mac OS virtual machine in VirtualBox! (T420, i5CPU) (2011-07-25 10:07:01) Reprint▼ label: Technology virtual machine iboot multibeast virtualbox mac os t420 it classification: Ma...

Libsvm in Mac OS environment installed in Matlab

In order to let everyone take a detour, be sure to share my lessons... Okay~ let's get started! Required materials: Macbook, Xcode, Matlab2014R,libsvm-3.21、optsPatch10.8.patch、xcode7_mexopts The origi...

WxWidgets 10.7 installed under Mac OS X

A, wxWidgets Introduction wxWidgets advertised using its library developedsoftwareOnly need toSourceMake a few changes (or completely do not change), you can compile and execute on a variety of platfo...

Docker installed on Mac OS X (rpm)

http://www.oschina.net/translate/installing-docker-on-mac-os-x?print Docker installed on Mac OS X note:Docker support Mac OS X 10.6 "Snow Leopard" and above. Docker engine uses a Linux kerne...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top