[Solved] Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in the package.json of a module in node_modules

Article Ab Siddik

Problem:

Recently, we working on a SPA(Single page application), we used React to develop this application. But when I try to setup this project in my PC I face Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in the package.json of a module in node_moduless issue.


Solution:

Actually, it happened because I was using the latest version of Node JS (v17.0.1). But to run the project I need Node js v14.18.1. Then I installed Node JS v14.18.1 by nvm (Node Version Manager). And after that, I successfully set up the project on my PC.

nvm install 14.18.1

Thank you for reading the article. Hope the given solution will solve your problem.