Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Build Napa.js

Yulong Wang edited this page Dec 27, 2017 · 5 revisions

Most of the time, there is no need to build Napa.js. When consuming Napa.js via npm install napajs, npm will first try to download the pre-build binaries for the current platform. The following situations are when build will happen:

  • using npm install napajs --no-fetch to specify a force build
  • current platform is not in supported pre-build platforms.
  • you are using other platform rather than Node.js. See Build Napa.js for Electron.
  • you want to build and test 'napajs' from source code. This is especially helpful when you have a combination of OS/compiler/Node version that is not explicitly mentioned as supported.

1. Install prerequisites

2. Build

Build via npm install

  • Add argument --no-fetch to the install command: npm install --no-fetch

Build from source

  • Clone the source code
    • Enter command line
    • Enter the directory that napajs will be cloned in its sub-folder named 'napajs'
    • git clone https://github.com/Microsoft/napajs.git
  • Run command npm install --no-fetch at the root directory of local repo.

3. Test

Enter the root directory of local repo in command line.

  • Run test: npm test
  • Run unittest: npm run unittest
Clone this wiki locally