在本机反应中得到“无法读取属性‘ pick松驰算法’为空”错误

运行 npm install时出错。 错误是:

npm ERR! Cannot read property 'pickAlgorithm' of null


npm ERR! A complete log of this run can be found in:
npm ERR!    npm-cache\_logs\2021-10-14T08_03_47_266Z-debug.log

我做了以下操作,但错误仍然存在:

  1. 删除 node-modules
  2. 删除给定的文件
  3. 运行 npm cache clear --force

环境:

操作系统: Windows10
本地反应: 0.65.1
节点: 14.17.4
Npm: 7.21.0

133940 次浏览

Upgraded to npm v7.23.0 and then npm install so it's working fine now.

The only thing that helped me was clearing cache:

npm cache clear --force

if you are using Windows OS, close VS Code then open command prompt as administrator and run npm cache verify and npm install

it works for me

please use following:

npm cache clear --force


npm install

in my case it is working

Running this worked for me

npm config set registry https://registry.npmjs.org/

i was try this step to solve that problem:

  1. close VS Code
  2. Run from CMD
  3. npm cache clear --force
  4. npm cache verify
  5. npm install -g create-react-app
  1. close VS code،

  2. Install last version Node

  3. CMD : npm install -g create-react-app

  4. npm cache clear --force

  5. npx create-react-app <projectName>

Or Reinstall node

I completely deleted nodejs and then reinstalled version 16 of it.

The following links are helpful:

First run npm cache clear --force and then close VPN. It worked for me (in China)

In my case we had an old package-lock.json that caused these issues. Regenerating package-lock.json fixed the issue. To do this delete package-lock.json and then run npm install

One of the packages was deprecated. I started in new folder a test project and then copied some of the packages to this tested project until found the problematic package.

create on new folder a test-project and open cmd in this location.

npm init -y // creates package.json with defaults copy to depencencies / devdependencies in that package.json packeges from the origin project. npm i

It seems that running

npm cache clear --force

Is what worked and recommended by everyone. Unfortunately, it did not work for me. There were other suggestions to save-dev first. This also did not work for me.

What I did in order to overcome this issue myself, was narrowing my package.json dependencies. I removed all of them, and kept returning them incrementally until I found the dependency that was causing the issue. I updated the dependency version, and this was what I needed to overcome this issue.

My problem was because the wifi adaptor of my PC was very inconsistent and would give network errors often, giving the error mentioned, among others, when trying to install bigger packages (in my case, expo). What helped in my case was tethering my android phone to PC and using the connection that way.

This link helped me getting it done: https://support.google.com/pixelphone/answer/2812516

npm upgrade npm to get the latest version of npm

For me, the error came up while I was trying to work with the json-server module. And clearing the cache worked for me

npm cache clear --force

Afterwards, reinstall/update your mode modules

npm install

If that doesn't work, try reseting you npm config:

npm config set registry https://registry.npmjs.org/

Solution 1: Cache Clear

First, run this command:- npm cache clear --force

Then run this command:- npm install

Solution 2: set npm config

You need to set npm config registry just like this.

npm config set registry https://registry.npmjs.org/

We can also run npm install with registry options for multiple custom registry URLs.

npm install --registry=https://registry.npmjs.org/
npm install --registry=https://custom.npm.registry.com/

If you are using the latest node version, just force to clean cache. command:

npm cache clear --force