DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at node_modules\postcss\package.json
Emily Wong
Since I upgraded Node to version 16, I started noticing this when I build my Angular app.
DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at "...\node_modules\postcss\package.json".
Update this package.json to use a subpath pattern like "./*".Is there a way to fix this without downgrading the Node version?
18 Answers
Solution:
- Go to defined location
C:\<xampp>\htdocs\<projName>\node_modules\tslib\package.json. - At exports field - replace this
"./": "./"to"./": "./*".
I was using node 16 switched back to 14 and it started working.
Regarding the GitHub issue, this one is recurrent one:
An update of postcss should do the job.
Go to your client directory in your project and npm i postcss.
Take a look at your package.json and check if you have --prod flag in the build script, if so update it for--configuration production
That will solve the issue, too
I suffered from the same issue but into tslib package
I tried updating version by version till this version 2.4.0
now everything works correctly
The best way to fix this is to downgrade to a lower version of Node. But not doing a reinstall of Node.
Install NVM - Node version manager. That way you can have multiple versions of Node at the same time. For each project, you will be able to switch to a specific Node version you want. It can be found at
Try with this:
Go to node_modules\postcss\package.json
swap out "./": "./" with "./*": "./"
1