How to fix “Module not found: Can't resolve &#

2019-08-26 01:34发布

I'm trying to get particlesjs to run in react. But that doesn't seem to work..So , I tried using react-particles-js .But it gives me this error: Module not found: Can't resolve 'react' in 'C:\Users\Amit\node_modules\particles-js\lib'

        import React, { Component } from 'react';

        import ParticleAnimation from 'particles-js';

         class Example extends Component {
            render () {
               return (
              <ParticleAnimation />
          )
        }
       }export default Example;

I've been trying to mess with the file path in the import statement but nothing has worked so far. Thank you for your time.

1条回答
你好瞎i
2楼-- · 2019-08-26 01:54

try to install it again in you project ,

yarn add react

or

npm i react --save

查看更多
登录 后发表回答