lukejmann / MintUI

172 stars 72 forks source link

Fails to launch on node --version = v17.2.0 #16

Open zkhalapyan opened 2 years ago

zkhalapyan commented 2 years ago

Pull latest, yarn install, yarn start, notice that it fails with error below in case of Node 17.X.

➜  MintUI git:(main) ✗ node --version
v17.2.0
➜  MintUI git:(main) yarn start
yarn run v1.22.17
$ concurrently -k "BROWSER=none craco start" "npm:electron"
[electron]
[electron] > MintUI@0.1.0 electron
[electron] > wait-on tcp:3000 && electron .
[electron]
[0] node:internal/errors:464
[0]     ErrorCaptureStackTrace(err);
[0]     ^
[0]
[0] Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in /Users/zkhalapyan/Desktop/MintUI/node_modules/postcss-safe-parser/node_modules/postcss/package.json
[0]     at new NodeError (node:internal/errors:371:5)
[0]     at throwExportsNotFound (node:internal/modules/esm/resolve:429:9)
[0]     at packageExportsResolve (node:internal/modules/esm/resolve:683:3)
[0]     at resolveExports (node:internal/modules/cjs/loader:482:36)
[0]     at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
[0]     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
[0]     at Function.Module._load (node:internal/modules/cjs/loader:778:27)
[0]     at Module.require (node:internal/modules/cjs/loader:999:19)
[0]     at require (node:internal/modules/cjs/helpers:102:18)
[0]     at Object.<anonymous> (/Users/zkhalapyan/Desktop/MintUI/node_modules/postcss-safe-parser/lib/safe-parser.js:1:17) {
[0]   code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
[0] }
[0]
[0] Node.js v17.2.0
[0] BROWSER=none craco start exited with code 1
--> Sending SIGTERM to other processes..
[electron] /Users/zkhalapyan/Desktop/MintUI/node_modules/electron/dist/Electron.app/Contents/MacOS/Electron exited with signal SIGTERM
[electron] npm run electron exited with code SIGTERM
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
zkhalapyan commented 2 years ago

Seems to be related to https://github.com/facebook/create-react-app/issues/11565. The only workaround other than waiting for facebook to update react is to downgrade npm i.e. nvm use 16.8.0.