Home > front end >  Issue with running npm start. Weird error
Issue with running npm start. Weird error

Time:11-25

I am having issues with getting npm run to start

node:internal/modules/cjs/loader:488
      throw e;
      ^

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

Here is the package.json

"name": "my-app",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.11.4",
    "@testing-library/react": "^11.1.0",
    "@testing-library/user-event": "^12.1.10",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-scripts": "4.0.3",
    "web-vitals": "^1.0.1"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },

any help would be awesome!

CodePudding user response:

This issue occurs when using the latest version of Node. Try rolling back to the LTS version 16.13.0.

Step 1:

nvm uninstall <version> 

Step 2:

nvm install --lts

This should work for Windows

CodePudding user response:

for that you need to downgrade the node version here is solution

Solution 1: Downgrade nodejs version

In my case I am using nodejs v17.0.1 and I am facing above error. So that I just downgrade my nodejs to LTS version My error solved automatically. To downgrade nodejs Just use this command. First of all just uninstall latest version. Use this command.

nvm uninstall v17.0.1

          OR

nvm uninstall <your version>

and then Install LTS version. Use this command.

nvm install --lts

Solution 2: Delete node_modules and reinstall

Just delete node_modules and and .lock file then re-install your packages. And again run npm start and now your error might be solved.

  • Related