1. Problem description:
In the vue project, when we use the command: npm install to download node_modules (node_module) in the terminal, an error occurs.
node_modules is the folder used to store packages downloaded and installed with package management tools after node is installed . Tools such as webpack, gulp, and grunt.
Mainly because of this: npm ERR! Cannot read properties of null (reading 'pickAlgorithm')
Translation: npm error! Cannot read property of null (reading 'pickAlgorithm')
2. Solution:
Run the command in the terminal: npm cache clear --force (npm cache clear --force)
If the previous command does not work, then npm cache clean --force (npm cache cleanup --force)
Generally speaking, after running the first command, the installation is successful. But after testing, some people need to use cache cleaning on their computers .
Everyone try a lot. The npm cache clear --force I used myself has obvious effects, and it succeeded in one go.
Then execute the command again to install: npm install (npm i)
Then start the project: npm run dev