• About Us
  • Blog
  • Basket
  • Account
  • Sign In
  •  

Node.js API

Installing the Node.js API

If you haven't already, you can obtain a copy of the latest version of the API using one of the links on the downloads page.

From npm

This is the quickest and easiest way to install 51Degrees node.js detector. Just use

$ npm install fiftyonedegreescore

*Note: fiftyonedegreeslitepattern fiftyonedegreeslitetrie will be installed as a dependencies.*

From git

However, if you want to build the package yourself and use the examples too. First clone 51Degrees/Device-Detection repository with

$ git clone https://github.com/51Degrees/Device-Detection.git

Move to the node.js directory with

 

$ cd Device-Detection/node.js

and install with

$ node copySource.js
$ npm install

Windows

Node has know issues installing modules in Windows. Three things must be in place before installing. 1. Install Visual C++ Build Tools 2. Install Python 2.7 and run npm config set python python2.7 3. Open a terminal and run npm config set msvs_version 2015

Alternatively, Microsoft have offered an npm package to install all this and can be run (in an elevated Power Shell) with npm install -g windows-build-tools.

Full explanation of windows issues can be found at https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md

 

Suggested Next Steps