Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Cannot find module 'winston' #2060

Open
hardyb opened this issue Feb 6, 2022 · 5 comments
Open

Error: Cannot find module 'winston' #2060

hardyb opened this issue Feb 6, 2022 · 5 comments

Comments

@hardyb
Copy link

hardyb commented Feb 6, 2022

The problem

When my application runs I am getting Error: Cannot find module 'winston'
and the app continually restart

I ran npm install with no errors
If I run this I get...

$ npm ls winston
smart-portal-api@0.0.0 /home/wwwroot/repos/test-smart-portal-api
└── winston@3.5.1

$

What version of Winston presents the issue?

v3.5.1

What version of Node are you using?

v14.19.0

If this worked in a previous version of Winston, which was it?

no previous

Minimum Working Example

No response

Additional information

No response

@wbt
Copy link
Contributor

wbt commented Feb 11, 2022

You'll need to add more detail about the importing code, and are likely to get better response asking on StackOverflow.

@hardyb
Copy link
Author

hardyb commented Feb 11, 2022

Apologies. This turned out to be an unexpected side effect of a bug in pm2 the was managing the start and stop of the process doing the import

@hardyb hardyb closed this as completed Feb 11, 2022
@rumanHuq
Copy link
Contributor

rumanHuq commented Aug 10, 2022

I encountered a similar issue. The main entry is missing the .js extension in package.json. The problem disappears if I provide "main": "./lib/winston.js" instead of "main": "./lib/winston"

image

@wbt
Copy link
Contributor

wbt commented Aug 10, 2022

Hmm, maybe a PR is in order then

@wbt wbt reopened this Aug 10, 2022
@rumanHuq
Copy link
Contributor

Hmm, maybe a PR is in order then

#2177

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants