Unable to resolve path to module './package.json' in React native application

477 Views Asked by At

I am trying to get application version in my react native app.

To get app version, I have written following code.

import { version } from './package.json';


      console.log(version.appVersion);

But, It's throwing error like following

[eslint] Unable to resolve path to module './package.json'. [import/no-unresolved]

Any suggestions?

1

There are 1 best solutions below

1
Anilkumar iOS Developer On

I have fixed is some syntax error in package.json Package.json data just check with https://jsonlint.com/ website wether it is valid json data or not.

I my case, There is one } symbol missed. So, Fixed. it.