DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at node_modules\postcss\package.json

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?

1

8 Answers

Solution:

  1. Go to defined location C:\<xampp>\htdocs\<projName>\node_modules\tslib\package.json.
  2. At exports field - replace this "./": "./" to "./": "./*".
3

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.

1

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

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like