3

I'm trying to use Nivo Pie Chart, it's giving me this error on import:

Unable to resolve path to module '@nivo/pie'

import { ResponsivePie } from '@nivo/pie';

Trying to figure out what needs to be installed, any help appreciated.

Penny Liu
  • 15,447
  • 5
  • 79
  • 98
Afaq Ahmed Khan
  • 2,164
  • 2
  • 29
  • 39

2 Answers2

6

You need to install first yarn add @nivo/core, from the documentation:

In order to use nivo, you have to install the @nivo/core package and then choose some of the scoped @nivo packages according to the charts you wish to use: https://github.com/plouc/nivo#installation

Penny Liu
  • 15,447
  • 5
  • 79
  • 98
Alan
  • 9,167
  • 4
  • 52
  • 70
4

You should install package before using it. Please try running

yarn add @nivo/pie

or

npm install @nivo/pie --save
Umair Farooq
  • 1,763
  • 13
  • 16