Home > Software engineering >  Module not found: Error: Package path ./v4 is not exported from package
Module not found: Error: Package path ./v4 is not exported from package

Time:04-06

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)```

Impoorted Using
```import uuidv4 from 'uuid/v4';```

CodePudding user response:

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

import { v4 as uuidv4 } from 'uuid';
  • Related