react-json-table icon indicating copy to clipboard operation
react-json-table copied to clipboard

module not found

Open caseyahlan opened this issue 7 years ago • 8 comments

I installed react-json-table with npm install react-json-table --save, but I'm getting the error "Module not found: Can't resolve 'react-json-table'." Any idea why it's not working?

caseyahlan avatar Jul 03 '18 16:07 caseyahlan

You getting that error when running npm install react-json-table --save?

agracio avatar Jul 03 '18 16:07 agracio

I'm getting the error on my site after running that

caseyahlan avatar Jul 03 '18 16:07 caseyahlan

Sorry, not following you. You are running npm install react-json-table --save in your project that contains package.json file and that command throws the error above? Or are you running code trying to use it and getting the error?

agracio avatar Jul 03 '18 16:07 agracio

I'm running npm install react-json-table --save in my project with a package.json file, but then when I run the code trying to use the package, my site won't build because of the error.

caseyahlan avatar Jul 03 '18 16:07 caseyahlan

You need to provide full code that you trying to execute and throws error.

agracio avatar Jul 03 '18 16:07 agracio

import statement: import { JsonTable } from 'react-json-table'

in my render(): <JsonTable rows={this.state.data}/>

caseyahlan avatar Jul 03 '18 16:07 caseyahlan

Try const JsonTable = require('react-json-table'); instead.

agracio avatar Jul 04 '18 09:07 agracio

I'll try that! I was actually able to make it work by using ts-react-json-table instead.

caseyahlan avatar Jul 04 '18 15:07 caseyahlan