Skip to content

Commit

Permalink
switch to prebuild instead of node-pre-gyp
Browse files Browse the repository at this point in the history
  • Loading branch information
wouterverweirder committed Jul 14, 2021
1 parent a749a08 commit ba38551
Show file tree
Hide file tree
Showing 9 changed files with 1,790 additions and 178 deletions.
12 changes: 7 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
Thumbs.db
build/
/prebuilds
/build
.prebuildrc
.node_pre_gyprc
.vscode/
build-tmp*/
lib/binding/
/build-tmp*
/lib/binding/

# Ignore the dll files in the root of this module and the examples folders and script folders
/*.dll
/*.onnx
/*.exe
/examples/**/*.dll
/examples/**/*.onnx
/scripts/*.dll
/scripts/*.onnx
/examples/**/*.exe

# Logs
logs
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,24 @@ Just npm install like you would do with any regular module.
$ npm install kinect-azure
```

### Potential issues

#### Error: The specified module could not be found

This module relies on some dll & onnx files from the kinect azure installation. If those files can't be loaded, loading the module will fail as well. You can can find those in the `Azure Kinect Body SDK\tools` directory. Either add that folder (eg C:\Program Files\Azure Kinect Body Tracking SDK\tools) to your PATH or copy the dll and onnx files into the root of your project.

#### MSBuild.exe ENOENT

You might run into the error below when trying to install this module:

> Error: spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\15.0\Bin\MSBuild.exe ENOENT
To fix this, make sure to install the latest version of node-gyp globally:

```
$ npm install -g node-gyp
```

## Examples

There are nodejs and electron examples in the examples/ folder of this repo. To run them, execute npm install and npm start:
Expand Down
7 changes: 4 additions & 3 deletions examples/electron/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion examples/electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"version": "1.0.0",
"main": "main.js",
"scripts": {
"start": "electron ."
"start": "electron .",
"copy-dlls": "xcopy \"C:\\Program Files\\Azure Kinect Body Tracking SDK\\tools\\\" . /H /C /Y"
},
"author": "Wouter Verweirder",
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion examples/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"version": "1.0.0",
"main": "skeleton-logging.js",
"scripts": {
"start": "node ."
"start": "node .",
"copy-dlls": "xcopy \"C:\\Program Files\\Azure Kinect Body Tracking SDK\\tools\\\" . /H /C /Y"
},
"author": "Wouter Verweirder",
"license": "MIT",
Expand Down
4 changes: 1 addition & 3 deletions lib/kinect-azure.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
const binary = require('@mapbox/node-pre-gyp');
const path = require('path');
const binding_path = binary.find(path.resolve(path.join(__dirname,'../package.json')));
const kinect = require(binding_path);
const kinect = require('./binding/napi-v4/kinectAzure.node');

class KinectAzure {

Expand Down
Loading

0 comments on commit ba38551

Please sign in to comment.