![]() If the error occurs even if you have the package installed, then the fixes suggested in this article can help you out. ![]() When you get the “cannot find module” error, or “module not found”, it means you’ve not installed the package you’re trying to use. install all packages again by running npm install.clean up the NPM cache by running npm cache clean -force.delete file by running rm -f package-lock.json.delete the node modules folder by running rm -rf node_modules.If you install the package but you still get the error, then follow the steps below: Once I install the package and run the app, everything should successfully compile: I’ll do that by running yarn add react-icons. In my case, I need to install the react-icons package so the freeCodeCamp icon can be resolved. To fix the error, you need to install the package that is absent in your project directory – npm install package-name or yarn add package-name. In my case, I got it like this "Module not found: Error: Can't resolve 'react-icons/fa' in 'C:\Users\user\Desktop\Projects\Address Locator\address-locator\src'". The module (package) not found is always specified in the format "Module not found: Error: Can't resolve 'package name' in 'project directory". A Node Puppeteer base image for running Puppeteer scripts. If you get this error, the solution is always in the error. Docker Puppeteer Project ID: 13728947 Star 3 549 Commits 3 Branches 18 Tags 4.7 GB Project Storage 18 Releases Topics: container gitlab-ci puppeteer Docker Puppeteer is a container image with the recommended configuration for using Puppeteer to drive a headless Chrome browser (from the Puppeteer project). How to Fix the "cannot find module" Error I’m getting the error because I’m trying to import the freeCodeCamp icon from the react-icons package, which I don’t have installed. In the screenshot below, you can see that I’m getting the error: you’re pointing to a file that does not exist. ![]() you’re importing some things from an outdated package. ![]() you’re trying to import an item from a module you don’t have installed in your project directory.This error occurs because of the following reasons: Why the "Error: cannot find module" Occurs In this article, I’m going to show you how to fix the error. If you’re a developer that works with Node JS and JavaScript libraries and frameworks like React, Vue, and Angular, then you might have encountered the "Error: cannot find module" error. ![]()
0 Comments
Leave a Reply. |