question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find module '/snapshot/<My project>/node_modules/mapnik/lib/binding/mapnik_settings.js' after packaging

See original GitHub issue

Hey there 😃, I’m trying to package my application and all works fine, but when I try to run the packaged executable, I get thrown the following error:

Error: Cannot find module '/snapshot/<My Project>/node_modules/mapnik/lib/binding/mapnik_settings.js'
1) If you want to compile the package/file into executable, please pay attention to compilation warnings and specify a literal in 'require' call. 2) If you don't want to compile the package/file into executable and want to 'require' it from filesystem (likely plugin), specify an absolute path in 'require' call using process.cwd() or process.execPath.
    at Function.Module._resolveFilename (module.js:545:15)
    at Function.Module._resolveFilename (pkg/prelude/bootstrap.js:1280:46)
    at Function.Module._load (module.js:472:25)
    at Module.require (module.js:594:17)
    at Module.require (pkg/prelude/bootstrap.js:1159:31)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/snapshot/<My Project>/node_modules/mapnik/lib/mapnik.js:8:16)
    at Module._compile (pkg/prelude/bootstrap.js:1254:22)
    at Object.Module._extensions..js (module.js:661:10)
    at Module.load (module.js:563:32)

I know that this has something to do with the module Mapnik, but the file is there and all works fine when running with node. I’ve read that this maybe has something to do with paths declared with __dirname…?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
AidanWrightcommented, Jul 14, 2019

what did you do?

3reactions
clvrkdevcommented, Apr 30, 2019

I resolved the issue. It had nothing to do with pkg, but rather my filestructure.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot find module '/snapshot/<My project>/node_modules ...
Hey there :-), I'm trying to package my application and all works fine, but when I try to run the packaged executable, I...
Read more >
3 - Stack Overflow
I want to combine storybooks and jest snapshot testing, but I don't get it working. As soon as I follow the doc and...
Read more >
Cannot find module nodemodule/@schematics/angular/utility ...
Fix: Cannot find module \nodemodules\@schematics\angular\utility\test. js Use these steps to resolve the problem 1. Uninstall package that ...
Read more >
Electron packager tutorial - Christian Engvall
I have tried cross-env, but NODE_ENV is undefined after the packaging, so it is not a solution. For sure, I am missing something...
Read more >
Zoom-macsdk-electron error - Meeting SDK
4 verbose stack Error: missing script: start ... /npm/node_modules/read-package-json/read-json.js:115:5 ... Error: Cannot find module '…
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found