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.

Problem with compiling projects with nexe that use winston

See original GitHub issue

Please tell us about your environment:

  • winston version?
    • winston@2
    • winston@3
  • node -v outputs: v8.11.3
  • Operating System? Windows
  • Language? ES6/7

What is the problem?

When I compile a project that uses winston with nexe project.js -o project.exe and use the integrated formatters, I get the error Cannot find module './format' or Cannot find module './combine.js'. When executing the project.js file directly everything works fine. The nexe compiling process didn’t show any errors.

Other information

Stacktrace

javascript Error: Cannot find module './combine.js' at Function.Module._resolveFilename (module.js:547:15) at Function.Module._load (module.js:474:25) at Module.require (module.js:596:17) at require (internal/module.js:11:18) ...

Related

There’s been a similar problem that was fixed with a newer release of winston. #178.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
NikolaNikushevcommented, Feb 21, 2020

I had the same issue and I was importing the following:

import { createLogger, transports,format } from "winston";

I changed the import for format to

import { format } from "logform/dist/browser";

and that solved it for me.

I am using https://parceljs.org/ for packaging a lambda.

2reactions
RPDeshaiescommented, Apr 9, 2019

FYI: this error is also triggered when using Parcel (http://parceljs.org) with the --target node flag.

I still haven’t found a way to fix that in my case

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I solve an nexe compilation code 2 error?
I am trying to compile my node server using nexe (3.3.2) but it keeps failing. When I first tried, it said I needed...
Read more >
How to Compile your Node.js Application into an Executable ...
In this video, I will show you how to take a Node.js application ... How to Compile your Node.js Application into an Executable...
Read more >
Node winston logging | logging in Node - YouTube
More exclusive content: https://productioncoder.com/you-decide-what-we- build -nextTwitter: https://twitter.com/productioncoderBlog: ...
Read more >
Winston Logger in JavaScript - Medium
When debugging an issue, this allows you to quickly locate the appropriate service or function. Create distinct logs for different application ...
Read more >
Nexe NPM - npm.io
These included files can be read in the application by using fs.readFile or fs.readFileSync . Compiling Node. By default nexe will attempt to...
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