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.

Can't package with pkg module

See original GitHub issue

It will result then following

> Warning Cannot include file %1 into executable.
  The file must be distributed with executable as %2.
  ..\node_modules\node-notifier\vendor\notifu\notifu.exe
  path-to-executable/notifier/notifu.exe

OS:windows 10

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
stevenwhitespacesystemscommented, Oct 1, 2018

Not sure for Windows as I haven’t got around to it yet but you usually have to copy that .exe file to the folder where your pkg executable is built.

i.e. copy notifu.exe to path-to-executable/notifier/notifu.exe

For any Mac user who got here, it was slightly different and PKG wasn’t totally clear.

> Warning Cannot include file %1 into executable.
The file must be distributed with executable as %2.
node_modules/node-notifier/vendor/terminal-notifier.app/Contents/MacOS/terminal-notifier
path-to-executable/notifier/terminal-notifier

You copy the terminal-notifier executable to the location like it states but you also need to copy the following files to the same location

- node_modules/node-notifier/vendor/terminal-notifier.app/Contents/Info.plist
- node_modules/node-notifier/vendor/terminal-notifier.app/Contents/Resources/en.lproj/MainMenu.nib

So in the end you should have the following structure at your build folder.

- path-to-executable/app
- path-to-executable/notifier/terminal-notifier
- path-to-executable/notifier/Info.plist
- path-to-executable/notifier/MainMenu.nib

Doing the above worked for me and executed the notification from the built pkg file.

3reactions
nicamcommented, Dec 20, 2020

@normen I found a workaround:

You need to copy the necessary files into the path-to-executable dir, in my base bin/

cp node_modules/node-notifier/vendor/mac.noindex/terminal-notifier.app/Contents/Resources/en.lproj/MainMenu.nib bin/notifier
cp node_modules/node-notifier/vendor/mac.noindex/terminal-notifier.app/Contents/Info.plist bin/notifier
cp node_modules/node-notifier/vendor/mac.noindex/terminal-notifier.app/Contents/MacOS/terminal-notifier bin/notifier

Then you need to create your own notifier, using customPath:

const notifier = new NotificationCenter({ customPath: path.resolve() + '/notifier/terminal-notifier', });

Read more comments on GitHub >

github_iconTop Results From Across the Web

pkg --public-packages unable to find "external" module
I am trying to pkg a project on my Mac, but for a Linux target. The project contains the npm module fs-ext ...
Read more >
Unable to install new packages or use ... - RStudio Community
Hi everyone, I am new in R. I was running DESeq2 tool for Differentially expression analysis in R version 3, OS: Windows 10....
Read more >
PyCharm can't install/import a package/library/module
Try installing/importing a package from the system terminal (outside of PyCharm) using the same interpreter/environment. In case you are using a ...
Read more >
Installing Packages — Industrial Training documentation
Install Package from apt Repository¶ · Open a terminal window. · Type apt install ros-melodic-calibration-msgs. · Type sudo apt install ros-melodic-calibration- ...
Read more >
Why Can't Python Find My Modules?
A common error that new Pythonistas will come across is that the packages they think they've installed are not actually being recognized by ......
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