You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Builds Don't Work with PostCSS After Update #11565
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in /tmp/workspace/node_modules/postcss-safe-parser/node_modules/postcss/package.json
In earlier versions of Node, this was just a deprecation warning:
Update this package.json to use a subpath pattern like "./*".
This is related to postcss/postcss-safe-parser#29. Which is actually entirely CRA's fault because react-scripts@4.0.3 is using PostCSS 7 (obsolete) and an old version of postcss-safe-parser.
It looks like the work fixing this issue was already merged in July (PostCSS was updated to version without this Node 17 issue in #11121, and postcss-safe-parser was removed in #11201). However none of that has been released yet. All of that is being pushed to CRA v5, however I don't see anything in the 5.0 milestone that should in any way block a CRA 5.0 release.
Reacted by Caleb Rogers, Gabriel Emilio, Guillaume Collard, crshumate, Ashley, Alexey Akimov, Zo, Logan George, Nina Tchirkova, Val Redchenko and 17 more
Reacted by Karthik Durai
Reacted by Dwayne Paisley-Marshall, bashonregardless, Aniruddha Shriwant and Sufian
Reacted by therohanchoudhary, John Brady, Nick, Adam Gardner, Deepak Sood, MarekBartczak, Philip Dahlstrøm, Ryan Pfister, Vera Lobacheva, luis-garcia-kr and 15 more
The solution of removing yarn.lock and node_modules does not work for me. I get a large number of these errors, and Yarn fails:
➤ YN0001: │ Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close
at new NodeError (node:internal/errors:371:5)
at PassThrough.onclose (node:internal/streams/end-of-stream:122:30)
at PassThrough.emit (node:events:390:28)
at emitCloseNT (node:internal/streams/destroy:145:10)
at processTicksAndRejections (node:internal/process/task_queues:82:21)
Having this issue, wiping out node_modules didn't work, the only solution that's worked for me is nvm use 16.8.0.
Reacted by Guillaume Collard, Ashley, Amir Rubin, dzmitry dranitski, Abhay Kumar, kritidipto-1234, luigijr44, sivaramaraju-v, stylings, Emmanuel Paul Moralde and 5 more
Package subpath './lib/parser' is not defined by "exports" in /home/node/app/node_modules/postcss/package.json I am getting an error like this today suddenly.
Reacted by Pham Anh Dung, Ali Moallim, Jack Burgess, Carlos Ortiz , trg, Yash Gupta, Em Kay, Adam Wong, sharjeel-jan, Jokanola Yusuff Olatunji and 5 more
Can we get a real fix and not downgrading Node version? Current LTS is now 18.13.0.
Reacted by Olushola Temiloluwa, Ricardo Martínez, roman-shestakov, Kevin Cunanan, Simon Prato, Ahmad Gani, Matthias Leu, Christopher Lange, Daniel Palafox, PK and 11 more
I was receiving Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/parser' is not defined by "exports" in ...node_modules\next\node_modules\postcss\package.json
I have resolved it on node version 17.4.0 after I upgraded react, and nextjs using: npm install react@latest react-dom@latest npm install next@12
npm i next@latest react@latest react-dom@latest eslint-config-next@latest
# or
yarn add next@latest react@latest react-dom@latest eslint-config-next@latest
# or
pnpm up next react react-dom eslint-config-next --latest
I used these commands to deploy to production on Vercel. Simply insert it in the "Install Command" field.
Rename your yarn.lock or package.lock files ending with -backup from github repo just incase of anything.
I was receiving Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/parser' is not defined by "exports" in ...node_modules\next\node_modules\postcss\package.json
I have resolved it on node version 17.4.0 after I upgraded react, and nextjs using: npm install react@latest react-dom@latest npm install next@12
Activity
shallow-alchemy commentedon Oct 23, 2021
I'm experiencing the same issue
dantman commentedon Oct 23, 2021
This is related to postcss/postcss-safe-parser#29. Which is actually entirely CRA's fault because
react-scripts@4.0.3is using PostCSS 7 (obsolete) and an old version ofpostcss-safe-parser.It looks like the work fixing this issue was already merged in July (PostCSS was updated to version without this Node 17 issue in #11121, and
postcss-safe-parserwas removed in #11201). However none of that has been released yet. All of that is being pushed to CRA v5, however I don't see anything in the 5.0 milestone that should in any way block a CRA 5.0 release.heymike777 commentedon Oct 23, 2021
Is there any fix for this?
vnva commentedon Oct 24, 2021
@Timashov, rolling back to Node 16.8.0 helped me.
experimatt commentedon Oct 24, 2021
@kanto2113 @dantman thank you for documenting this issue. I'm in the exact same boat, and am eagerly awaiting a possible solution.
shallow-alchemy commentedon Oct 25, 2021
Nuked my node modules and yarn.lock and ran
yarn installand it worked. Using cra typescript template.ValeriMladenov commentedon Oct 26, 2021
Just remove yarn.lock & node_modules & run
yarnFelicitusNeko commentedon Oct 26, 2021
The solution of removing yarn.lock and node_modules does not work for me. I get a large number of these errors, and Yarn fails:
shallow-alchemy commentedon Oct 26, 2021
@FelicitusNeko what version of node are you on?
FelicitusNeko commentedon Oct 26, 2021
@MatthewPardini I switched to Node 17.0.1 using NVM and gave it a try. No good. Also, this is using Yarn 3.0.2.
komali2 commentedon Oct 27, 2021
Having this issue, wiping out node_modules didn't work, the only solution that's worked for me is
nvm use 16.8.0.fix(web): 🐛 use node 16 until CRA fixed ref react/create-react-app#11565
shivamdave22 commentedon Nov 1, 2021
Package subpath './lib/parser' is not defined by "exports" in /home/node/app/node_modules/postcss/package.json I am getting an error like this today suddenly.
27 remaining items
melleveapp commentedon Feb 17, 2022
i downgraded version node, and worked
rjcallahan commentedon Mar 2, 2022
npm audit fix --force also fixed this issue for me
zeelz commentedon Apr 25, 2022
My node was 17.0. Had to get LTS
nvm install ltsIf you don't have nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bashsource ~/.nvm/nvm.shremoved error of postcss
Konglomneshued commentedon Jan 14, 2023
Can we get a real fix and not downgrading Node version? Current LTS is now 18.13.0.
atwellpub commentedon Feb 17, 2023
This worked for me
ayansome1 commentedon May 2, 2023
Upgrading should solve your issue:
https://nextjs.org/docs/upgrading
appfliiq-x commentedon May 30, 2023
I used these commands to deploy to production on Vercel. Simply insert it in the "Install Command" field.
Rename your yarn.lock or package.lock files ending with -backup from github repo just incase of anything.
npm install next@12 && npm install react@latest react-dom@latest && npm i --package-lock-only && yarn install && npm audit fix --forcemoomoo-dev commentedon Jul 5, 2023
Was this ever fixed?
moomoo-dev commentedon Jul 5, 2023
Ok so I actually got pass this issue but updating to postcss": "8.2.12"
foverokavindz commentedon Aug 31, 2023
this works for me
sahumanika commentedon Oct 12, 2023
Yes, it works for me too.
rphcompany commentedon Jun 11, 2024
Worked for me as well.
node 16
davidrajm commentedon Nov 30, 2024
Downgrading the node version to 16.8.0 only sorted out the issue event in end of 2024.