react-notifications icon indicating copy to clipboard operation
react-notifications copied to clipboard

Module not found: Error: Can't resolve 'react-notifications'

Open daveteu opened this issue 7 years ago • 4 comments

Installed via Yarn add react-notifications

and follow to import in component like this

import {NotificationContainer, NotificationManager} from 'react-notifications';

webpack: Failed to compile. Error: Cannot find module 'react-notifications' at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (module.js:417:25) at Module.require (module.js:497:17) at require (internal/module.js:20:19)

daveteu avatar Dec 04 '17 01:12 daveteu

Hi, I'm using 'react-notification' in our project with material UI. As 'react-notification' is the npm package you cannot install it using YARN(didn't work for us either). And when we did it with npm install 'react-notifications' --save, it worked for us. Also, if you're installing in the root, you need to add 'sudo'. Please let me know, if you find other way to install using YARN and please try installing it with npm install. Thanks in advance :)

AnkitSaxena24 avatar Oct 11 '18 05:10 AnkitSaxena24

I have the same issue too.

moonjoungyoung avatar Oct 31 '18 05:10 moonjoungyoung

Any solution ? I am using (create-react-ap) and with npm I am getting this error Could not find a declaration file for module 'react-notifications'. 'd:/workspace/portfolio/node_modules/react-notifications/lib/index.js' implicitly has an 'any' type. Try npm install @types/react-notifications if it exists or add a new declaration (.d.ts) file containing declare module 'react-notifications';ts(7016)

tmnrp avatar Sep 05 '20 15:09 tmnrp

For those of you that run into this error and just want this to work, you just tell typescript to ignore the next line for now until type definitions become available via npm install @types/react-notifications (still not available as of writing).

// @ts-ignore
import { NotificationContainer, NotificationManager } from 'react-notifications';

You can find more information on this page: Don’t let TypeScript slow you down

dimadotspace avatar Nov 04 '20 20:11 dimadotspace