nodeJS + npm setup

1. Download the msi : http://nodejs.org/download/
2 .Run the node cmd prompt
3. install modules using npm install command Eg. npm install mongodb
4. in case the GET fails ( Eg. from GET https://registry.npmjs.org/express/2.5.9 )
then download the repo from github and then install it :

Eg.
I downlaoded Karma-master.zip and then :
> C:\Users\khematar>cd C:\Users\khematar\Bin\karma-master\karma-master
> npm install

 

Additional Setup for Native Modules support (like for node-sass)

BEST: https://github.com/Microsoft/nodejs-guidelines

https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#compiling-native-addon-modules

  • Install https://github.com/nodejs/node-gyp post below prerequisites: On Windows:
    • Option 1: Install all the required tools and configurations using Microsoft’s windows-build-tools using npm install --global --production windows-build-tools from an elevated PowerShell or CMD.exe (run as Administrator).
    • Option 2: Install tools and configuration manually:
      • Visual C++ Build Environment:
        • Option 1: Install Visual C++ Build Tools using the Default Install option.
        • Option 2: Install Visual Studio 2015 (or modify an existing installation) and select Common Tools for Visual C++ during setup. This also works with the free Community and Express for Desktop editions.

        :bulb: [Windows Vista / 7 only] requires .NET Framework 4.5.1

      • Install Python 2.7 (v3.x.x is not supported), and run npm config set python python2.7 (or see below for further instructions on specifying the proper Python version and path.)
      • Launch cmd, npm config set msvs_version 2015
        • Check the right version using this: https://itayhauptman.wordpress.com/2016/04/10/msbuild-error-msb4019-the-imported-project-cmicrosoft-cpp-default-props-was-not-found-confirm-that-the-path-in-the-declaration-is-correct-and-that-the-file-exists-on-disk/

    If the above steps didn’t work for you, please visit Microsoft’s Node.js Guidelines for Windows for additional tips.

If you have multiple Python versions installed, you can identify which Python version node-gyp uses by setting the ‘–python’ variable:

$ node-gyp --python /path/to/python2.7

If node-gyp is called by way of npm and you have multiple versions of Python installed, then you can set npm‘s ‘python’ config key to the appropriate value:

$ npm config set python /path/to/executable/python2.7
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s