close

[Solved] Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath ‘./lib/tokenize’ is not defined by “exports”

Hello Guys, How are you all? Hope You all Are Fine. Today I am just trying to run my Reactjs Project but Whenever I am execute npm start command I am Facing followin error Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath ‘./lib/tokenize’ is not defined by “exports” in reactJs. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath ‘./lib/tokenize’ is not defined by “exports” Error Occurs ?

I am just trying to run my Reactjs Project but Whenever I am execute npm start command I am Facing followin error.

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

How To Solve Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath ‘./lib/tokenize’ is not defined by “exports” Error ?

  1. How To Solve Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by “exports” Error ?

    To Solve Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by “exports” Error Just Downgrade nodejs to LTS version. So You just need to Use node.js v14.18.1 and remove the latest version just use the stable version v14.18.1 ( For Now ). To uninstall old version of node use This command. nvm uninstall <Your version> In My Case I want to uninstall Node latest version of 17.0.1 so That I will run this command. nvm uninstall v17.0.1 Then use the stable version LTS which is v14.18.1 Just run this command. nvm install –lts Now, Your error must be solved.

  2. Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by “exports”

    To Solve Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by “exports” Error Just Downgrade nodejs to LTS version. So You just need to Use node.js v14.18.1 and remove the latest version just use the stable version v14.18.1 ( For Now ). To uninstall old version of node use This command. nvm uninstall <Your version> In My Case I want to uninstall Node latest version of 17.0.1 so That I will run this command. nvm uninstall v17.0.1 Then use the stable version LTS which is v14.18.1 Just run this command. nvm install –lts Now, Your error must be solved.

Solution 1: Use LTS version of Nodejs

Just Downgrade nodejs to LTS version. So You just need to Use node.js v14.18.1 and remove the latest version just use the stable version v14.18.1 ( For Now ).

To uninstall old version of node use This command.

nvm uninstall <Your version>

In My Case I want to uninstall Node latest version of 17.0.1 so That I will run this command.

nvm uninstall v17.0.1

Then use the stable version LTS which is v14.18.1 Just run this command.

nvm install --lts

Now, Your error must be solved.

Solution 2: Try reinstalling node packages

Just Try reinstalling node packages.

  1. First of all Remove node_modules folder and .lock file.
  2. Then , re-install your packages with npm Or yarn.
  3. Now, run your project again.
  4. Hopefully It should be worked.

Summary

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also, Read

Leave a Comment