Module not found: Error: Can't resolve 'os'
See original GitHub issue- Node Version: 8.11.1
- Npm Version: 5.6.0
- Platform: Mac OS 10.13.4
- Package Version: 5.1.3
I am using Contentful with Angular and have set up the service in my project following the instructions here. Everything worked perfectly with Angular 5.x, but I get the following error after upgrading to Angular 6:
ERROR in ./node_modules/contentful-sdk-core/dist/es-modules/get-user-agent.js
Module not found: Error: Can't resolve 'os' in '/Users/dbellizio/Dev/epri/epri-mcr-poc/node_modules/contentful-sdk-core/dist/es-modules'
My project is Angular CLI based, which as of version 6 now uses webpack 4 for the build process. Angular 5 uses webpack 3. So I’m wondering if that has something to do with it. The error occurs when running ng serve
or any other Angular CLI build command.
For what it’s worth, I tried upgrading to version 6.1.0 of Contenful, but the error remains.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:20 (11 by maintainers)
Top Results From Across the Web
Can't resolve 'os' , webpack 5 - Stack Overflow
Module not found : Error: Can't resolve 'os' in 'C:\Users\Arex\Desktop\webpack5-react-boilerplate-master\node_modules\xhr2-cookies\dist'.
Read more >Angular CLI: "Module not found: Error: Can't resolve..."
In this article, I will walk you through how to fix a an error that many people are encountering with Angular CLI 6+....
Read more >module-not-found - Next.js
Possible Ways to Fix It · The module you're trying to import is not installed in your dependencies · The module you're trying...
Read more >Resolve | webpack
When enabled, webpack would prefer to resolve module requests as relative requests instead of using modules from node_modules directories. webpack.config.js
Read more >module not found: can't resolve imported dependency "fs"
Jul 23, 2019 ... The error is because of angular-cli does not support modules in node like "fs" and "path". (Issue). Add the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I got this issue for a different library, but solved it by running
npm install --save os
@bellizio yes