[Fix] npm ERR! Cannot read property ‘pickAlgorithm’ of null

The error “npm ERR! Cannot read property ‘pickAlgorithm’ of null” is an error that is invoked whenever you are coding in react. and trying to do a command npm install. Given below is the snippet of the error:

npm ERR! Cannot read property 'pickAlgorithm' of null

I would like to share with you the steps I took to fix the “npm ERR! Cannot read property ‘pickAlgorithm’ of null” in your project file.

Why “npm ERR! Cannot read property ‘pickAlgorithm’ of null” error is seen?

The error, “npm ERR! Cannot read property ‘pickAlgorithm’ of null” is seen because; either you have too much cache data or you don’t have enough space in your system for your package file.

The detailed solution to fix the error “npm ERR! Cannot read property ‘pickAlgorithm’ of null”, is given below:

How to fix the error, “npm ERR! Cannot read property ‘pickAlgorithm’ of null”?

To fix the error, you will have to clear your cache data. If still facing the error, you will have to try to downgrade your npm version.

To fix the error, “npm ERR! Cannot read property ‘pickAlgorithm’ of null”, you will have to clear your cached data. If you still face the error, you will have to try to downgrade your npm version.

To fix the error, “npm ERR! Cannot read property ‘pickAlgorithm’ of null”, follow one of the below mentioned steps:

Method 1: Clear cache method

To fix the error, “npm ERR! Cannot read property ‘pickAlgorithm’ of null”, first you will have to force clear your cache data.

To clear your cached data type the below mentioned command:

npm cache clear --force

Then just do a simple npm install and it should fix the error, “npm ERR! Cannot read property ‘pickAlgorithm’ of null”.

Method 2: Downgrade your npm version

If the error, “npm ERR! Cannot read property ‘pickAlgorithm’ of null”, is not fixed by method 1 you will to consider downgrading your npm version.

npm v8.1.2 update is facing this error, so to fix the error you should try downgrading to version npm v7 by following the below mention command:

npm install -g npm@7.24.2

Conclusion

To fix the error “npm ERR! Cannot read property ‘pickAlgorithm’ of null”, clear your cached data. If you are still facing the error, try to downgrade your npm version.