Skip to content

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in the package.jso #6

Open
@Manuel-Suarez-Abascal

Description

@Manuel-Suarez-Abascal

Describe the bug

When trying to run the project in development mode using NodeJS version 18.7.0, the app doesn't compile & throws an error message.

Steps to reproduce:

  • Having Node's version 18.7.0 installed.
  • navigate to the project's root & install the project's dependencies with the following command: npm i.
  • try starting the project with npm run start.

Expected results:
It was expected to compile in dev mode & launch React's an app in the browser like in the screenshot below:

Screenshot 2022-11-23 at 3 32 09 PM

Actual results:
It doesn't compile & it throws the following error instead:

[Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in the package.jso]

Workaround: 1

  • run the following commands:
npm i -D postcss@latest
export NODE_OPTIONS=--openssl-legacy-provider
npm install

Workaround: 2

  • uninstall NodeJs 18.7.0 version.
  • install NodeJs 19.1.0 version.

Start the project with the command: npm run start. The app should compile now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions