0

I'm trying to create a SVG component. I have this problem after run command "npm i". I think versions between packages aren't compatible. How to fix this or create SVG component without react-native-svg package? Thank a lot.enter image description here

1 Answers1

0

Add the following to package.json:

{ 
  // scripts, dependencies, etc.

  "resolutions": {
    "css-what": "5.0.1"
  },
}

Remove lock file. Install the packages. Check if the app is still working. If works then keep the configuration (and ignore the warnings) else revert it.

Since you are using npm, you may wanna first refer this thread: npm equivalent of yarn resolutions?

brc-dd
  • 10,788
  • 3
  • 47
  • 67
  • It doesn't work with my case, are there other ways to create svg without this package ? – Thành Đạt Nguyễn Jun 22 '21 at 05:36
  • I am not well experienced with `react-native`, but the vulnerability of [`css-what`](https://github.com/fb55/css-what) is safe to ignore unless you yourself (or some package) use it to parse CSS selectors such that they would cause DoS. You can read the advisory here: https://github.com/advisories/GHSA-q8pj-2vqx-8ggc – brc-dd Jun 22 '21 at 06:28