0

I am importing d3 library using:

import * as d3 from 'd3'; 

But it gives me this error:

15:20-27 "export 'time' (imported as 'd3') was not found in 'd3'

The reason being, the code is using d3 v3 and I am importing d3 v4. How do I restrict it to using d3 v3 instead ? In package.json, then d3 version looks like:

"d3": "^5.1.0"
user2128
  • 590
  • 2
  • 13
  • 35

1 Answers1

2

Try the latest v3 version setting it directly in your package.json:

"d3": "3.5.17"

Then proceed to install again the packages with your favorite package manager:

npm install

or

yarn install

If using npm and having a version upper than 5, I would suggest you to delete first the package-lock.json to avoid any problem.

Dez
  • 5,702
  • 8
  • 42
  • 51