Hello!
I was wondering if there was a way to ignore a specific missing file.
Summary:
pkg tries to resolve all path.join calls and we can be punished for a missing file that might not be important. A .pkgignore file might make sense for this?
Long version:
Here's my use case because maybe there's another/cleaner way of fixing this.
When I try to build my binaries I get this error:
> Error! Cannot stat, ENOENT
/Users/zmarouf/my_module/node_modules/tabtab/.completions/cache.json
The file was required from '/Users/zmarouf/my_module/node_modules/tabtab/src/cache.js'
This is the problematic code:
var cachefile = path.join(__dirname, '../.completions/cache.json');
...
this._cache = exists(cachefile) ? require(cachefile) : { timestamp: Date.now(), cache: {} };
My hacky way of fixing this right now is to just touch the missing file but that's—well— ugly and not very practical.
What do you think? What are your suggestions on this? :)
I did a quick search in the issues for a similar problem but it didn't yield anything.
If there's already an open/closed discussion about this then could you please direct me to it?
Thank you in advance for your time!
Please upgrade to [email protected] and try again
Works great. 'So happy to be able to ditch the ugly intermediate touch command.
Thanks! :)
I've seen this problem with another dependency (and another file name):
Error! Cannot stat, ENOENT
/home/tasso/project/node_modules/strong-globalize/lib/local-credentials.json
The file was required from '/home/tasso/project/node_modules/strong-globalize/lib/translate.js'
@tassoevan Fixed by https://github.com/zeit/pkg/commit/ae0f9cec1a1d55355bce3cb2004e33ae04dee309. Please upgrade to 4.2.3
What do you think follow a similar approach than up?https://up.docs.apex.sh/#configuration.ignoring_files
Just with a list of git ignore pattern matches at .pkgignore could simplify it.
Most helpful comment
What do you think follow a similar approach than up?https://up.docs.apex.sh/#configuration.ignoring_files
Just with a list of git ignore pattern matches at
.pkgignorecould simplify it.