Skip to content

Fix error: Cannot find module './binding/node_osrm.node'Β #7272

@PierreLouisLetoquart

Description

@PierreLouisLetoquart

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

Today I used patch-package to patch @project-osrm/[email protected] for the project I'm working on.

The bindings for node are now in the binding_napi_v8 folder, but the var OSRM exported request the old folder path.

Here is the diff that solved my problem:

diff --git a/node_modules/@project-osrm/osrm/lib/index.js b/node_modules/@project-osrm/osrm/lib/index.js
index 20aa78f..d9eb5d0 100644
--- a/node_modules/@project-osrm/osrm/lib/index.js
+++ b/node_modules/@project-osrm/osrm/lib/index.js
@@ -1,2 +1,2 @@
-var OSRM = module.exports = require('./binding/node_osrm.node').OSRM;
+var OSRM = module.exports = require('./binding_napi_v8/node_osrm.node').OSRM;
 OSRM.version = require('../package.json').version;

This issue body was partially generated by patch-package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions