📜 ⬆️ ⬇️

Step-by-step installation of Node.js on Windows without virtualok

This article is intended for those who are enraged by the milen left services and drivers that put any virtualka. Those who will put additional. Node.js packages
All others can download the compiled Node.js node-js.prcn.co.cc
Or install Node.js from virtual nodejs.ru/25

I ask under the cat

Absolutely without virtualok, of course, will not do in passing, we will have to put Cygwin. Which is deprived of the left windows-services, which I was incredibly pleased.

Downloading Cygwin setup.exe - 670 KB cygwin.com/setup.exe

Install cygwin

We start, will offer to choose the installation path, it is better to put in c: \ cygwin \
Next, I will offer to choose the path where the packets will be flooded, my choice fell on c: \ cygwin \ p \
Next, I will offer to choose a mirror from where I will download the packages - I chose ftp.linux.kiev.ua - the speed of return is very good

Now we need to install the packages required for the installation and operation of Node.js
Dev - we put all or only packages below
- gcc g ++ C ++ compiler
- gcc mingw-g ++
- gcc4-4 ++ G ++ subpackage
- git
- make
- openssl
- pkg-config
- zlib-devel
Python - we put everything
- wget

The package selection window is like this:

The installer will collect the dependencies and install all the minutes in 5 minutes with a return of 8 Mbit / s

Patch patch rebaseall

Open the file C: \ Cygwin \ bin \ rebaseall with a Windows notepad

If the username is not Latin (approx. Administrator), then we find
Replace with

If we work under the 7th Windows, then we find
sed -e '/cygwin1\.dll$/d' -e '/cyglsa.*\.dll$/d' -e 's/^/\//' >"$TmpFile"
Replace with
sed -e '/cygwin1\.dll$/d' -e '/cyglsa.*\.dll$/d' -e 's/^/\//' -e '/\/sys-root\/mingw\/bin/d' >"$TmpFile"

There is no need to patch anything

Patch library

Close Cygwin if opened
Run the windows command prompt
in it we drive C: \ cygwin \ bin \ ash.exe
We drive in ./rebaseall –v

As a result, we will see something like this:
/usr/lib/dde1.2/tcldde12.dll: new base = 69050000, new size = 20000
... ...
/usr/lib/reg1.1/tclreg11.dll: new base = 69030000, new size = 20000
/usr/bin/cygz.dll: new base = 69000000, new size = 30000

Close the Windows command prompt

Run Cygwin

We start Cygwin at the first start, it will create a directory for the current windows user in its environment
I have c: \ cygwin \ home \ Administrator \

We put Node.js

We download the latest stable version and install

 $ wget http://nodejs.org/dist/node-latest.tar.gz $ tar xvf node-latest.tar.gz $ cd node-v0.2.4/ $ ./configure $ make $ make install 

If swears on openssl
 ./configure --without-ssl 

We try to start Node.js
 $ node --version v0.2.4 

Create a test application for Node.js

Create a file c: \ cygwin \ home \ Administrator \ www \ server.js
 var http = require('http'); http.createServer(function (request, response) { response.writeHead(200, {'Content-Type': 'text/html'}); response.end('<b>Hello World from Cygwin</b>'); }).listen(8124); console.log('Server running at'); 

We start our server

 $ node /home//www/server.js 

Here windows firewall may be cursed - we allow anything that asks
If you saw Hello World from Cygwin, then everything worked out for you, congratulations.

Other fixes

In order for Node.js to work with external DNS, you need to create the file /etc/resolv.conf and write to it

These are Google Public DNS addresses.

Based on

Source: https://habr.com/ru/post/107232/

All Articles