Главная » Error » Error error package path not exported

Error error package path not exported

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]

The error happens often in Next.js projects when issuing the npm run dev command and gets resolved after running npm update.

If that didn’t resolve your issue, run the node -v command and make sure you are running the long-term supported version of Node.js.

I keep on getting this error since I installed this module yesterday

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /home/dev/projects/api/node_modules/jose/package.jso
This error means you're doing require/import of just jose. Please refer to each individual module's documentation on how to require/import the respective functions.

We work on a Sage10 website on two different computers, node and yarn are strictly in the same versions, files are synchronized with git. Error [ERR_PACKAGE_PATH_NOT_EXPORTED]

For every new install, the installation is started with this edited package.json file, despite there is no error during the installation, the build breaks.
Trying to reinstall node_modules, starting from the edited package.json file, fails on every computer.

The solution :

  • replace edited package.json file with the initial file from Roots/sage
  • yarn install + do a complete install of other added modules, as they are not listed in package.json

Can you show the docs for this?

Can you try this?

import Swiper, { Grid, Lazy, EffectFade, Navigation, Pagination, Scrollbar, EffectCoverflow} from 'swiper';
Swiper.use([Grid, Lazy, EffectFade, Navigation, Pagination, Scrollbar, EffectCoverflow]);
A package is a folder tree described by a package.json file. The package consists of the folder containing the package.json file and all subfolders until the next folder containing another package.json file, or a folder named node_modules.
In general the exports field should contain an object where each properties specifies a sub path of the module request. For the examples above the following properties could be used: "." for import "package" and "./sub/path" for import "package/sub/path". Properties ending with a / will forward a request with this prefix to the old file system lookup algorithm. For properties ending with ** may take any value and any * in the property value is replaced with the taken value.

PCF Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath ‘./v4’ is not defined by “exports”

This should be fixed with the latest update on the pac CLI which has the hotfix for this issue 

>> pac install latest

>> pac use latest

1 Звезда2 Звезды3 Звезды4 Звезды5 Звезд (Пока оценок нет)
Загрузка...

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Adblock
detector