Milan
Milan

Reputation: 183

Module not found: Error: Package path ./v4 is not exported from package

I was building a react project but when I tried to run it. It showed the following error:

Module not found: Error: Package path ./v4 is not exported from package
....\node_modules\uuid (see exports field in ....\node_modules\uuid\package.json)

I imported using the following code:

import uuidv4 from 'uuid/v4';

Upvotes: 5

Views: 3949

Answers (1)

NeERAJ TK
NeERAJ TK

Reputation: 2695

Looks like an import issue in uuid. Try updating the import statement as:

import { v4 as uuidv4 } from 'uuid';

Upvotes: 6

Related Questions