minhtranite / react-notifications

Notification component for ReactJS
https://www.npmjs.com/package/react-notifications
287 stars 64 forks source link

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

Open daveteu opened 6 years ago

daveteu commented 6 years ago

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)

AnkitSaxena24 commented 5 years ago

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 :)

moonjoungyoung commented 5 years ago

I have the same issue too.

tmnrp commented 4 years ago

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)

dimadotspace commented 3 years ago

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