1

I'm trying to run react app I got this error:

☁  app [master] yarn start
yarn run v1.22.17
$ react-scripts start
node:internal/modules/cjs/loader:488
      throw e;
      ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in /Users/li/Documents/reacts/app/node_modules/postcss-safe-parser/node_modules/postcss/package.json
    at new NodeError (node:internal/errors:371:5)
    at throwExportsNotFound (node:internal/modules/esm/resolve:416:9)
    at packageExportsResolve (node:internal/modules/esm/resolve:669:3)
    at resolveExports (node:internal/modules/cjs/loader:482:36)
    at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/li/Documents/reacts/app/node_modules/postcss-safe-parser/lib/safe-parser.js:1:17) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

Node.js v17.0.1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

How do I download the app ?

npx create-react-app my-app
cd my-app
npm start

my stuff version

node -v v17.0.1

yarn -v 1.22.17

npm -v 8.1.4

I've tried every single thing in this but nothing worked for me

regosa
  • 63
  • 1
  • 9

2 Answers2

0

I was also getting this error, then I ran npm update and that seemed to clear up this error. But now I'm getting a new error about "no such file or directory, stat '/home//.steampath'"

Maybe that's just a separate issue with mine though, hopefully npm update works for you!

Edit: I was able to fix my "no such directory" error, it was caused by an issue with me trying to transfer a file from a different drive. I was able to resolve it. So unless you also have that same problem, npm update should fix it for you.

0

I had this issue, as well. I was able to get CRA to work by installing/using Node v16.13.1 via NVM. This is an issue with CRA depending on an old version of postcss-safe-parser referenced here.

First install NVM and then ...

nvm install 16

Make sure node 16 is being used by NVM and yarn start should work.

Dharman
  • 30,962
  • 25
  • 85
  • 135