Cannot find module '/snapshot/<My project>/node_modules/mapnik/lib/binding/mapnik_settings.js' after packaging
See original GitHub issueHey 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:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
what did you do?
I resolved the issue. It had nothing to do with pkg, but rather my filestructure.