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 resolve `os` in file [index.js]

See original GitHub issue

in line 73, required module os, but not found in package.json.

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
markgoho-EDTcommented, May 4, 2018

Getting this as well in an Angular project. v6

workaround: installed os as a dev dependency in my project

3reactions
DamonOehlmancommented, May 5, 2018

Looks like I need to perform a better “is node” check. Currently the test is:

var isNode = typeof navigator === 'undefined' && typeof process !== 'undefined';

Which seems to be firing false positives in particular environments (Angular v6 being one example). Alternatively, perhaps I should consider removing the ability to detect if the code is running on the server at all. I doubt it’s being used by many people and as long as it’s done in a major version bump that should be acceptable.

I’d prefer that you don’t have to add a workaround like adding os as a dev dep to your project.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module not found: Error: Can't resolve 'os' [Solved] | bobbyhadz
The first thing you should try is to set the browser.os property to false in your package.json file. package.json.
Read more >
Can't resolve 'os' , webpack 5 - Stack Overflow
I ran into a similar problem. It's because Webpack 5 doesn't include polyfills for node.js anymore. A simple solution:.
Read more >
module not found: error: can't resolve 'fs' - You.com
It looks like you're calling the fs file-exists method in your index.js file. I'm not sure in what context you're calling the method,...
Read more >
Resolve | webpack
js application bundled by webpack will first try to resolve using the file in the module field. resolve.mainFiles. [string] = ['index']. The filename...
Read more >
module-not-found - Next.js
The module you're trying to import has a different casing ... Make sure the casing of the file is correct. ... Incorrect casing...
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