chrisminnick/react-js-foundations

npm start failing at /react-js-foundations/react-book-store

ArbitCode opened this issue · 3 comments

Hi

while I was reading book that time, need to work on the cloned project but after cloning the project and npm install. npm sart is not working

My setup details:
node --version
v17.8.0
npm --version
8.6.0

How to reproduce:

  1. git clone https://github.com/chrisminnick/react-js-foundations
  2. npm install
  3. npm start

Error details:
raja@Rajas-MacBook-Air react-book-store % pwd
/Users/raja/Documents/React/react-js-foundations/react-book-store
raja@Rajas-MacBook-Air react-book-store % npm start

react-bookstore@0.1.0 start
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/raja/Documents/React/react-js-foundations/react-book-store/node_modules/postcss-safe-parser/node_modules/postcss/package.json
at new NodeError (node:internal/errors:372:5)
at throwExportsNotFound (node:internal/modules/esm/resolve:448:9)
at packageExportsResolve (node:internal/modules/esm/resolve:727: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. (/Users/raja/Documents/React/react-js-foundations/react-book-store/node_modules/postcss-safe-parser/lib/safe-parser.js:1:17) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

Node.js v17.8.0

Thanks for submitting this issue! It seems there was a problem with that package and node 17. I upgraded the react bookstore project to React 18, and it's working now.

Do a git pull and then npm install and you should be good. Let me know if not!

Thank you @chrisminnick
now it's working good.