0
Follow
0
View

npm i reports an error code451

cxandcf 注册会员
2023-02-25 10:16

5 sources have been changed, npm i also use npm cache clean --force clean cache, Only < a href = "https://registry.npmmirror.com/ to 451, the rest of the newspaper" target = "_blank" > https://registry.npmmirror.com/ at 451, 404 Not Found - GET https://cdn.npmmirror.com/packages/vue-plugin-rely/2.6.14/vue-plugin-rely-2.6.14.tgz < / a >

kritos 注册会员
2023-02-25 10:16

This part of the answer refers to GPT, GPT_Pro better to solve the problem
This situation is very likely to be the npm source problem, because your colleague's side is working normally, and you are wrong. Try it out with different npm sources, which is also a common solution.

The specific steps are as follows:
  1. View npm sources currently in use: You can use npm config get registry to view npm sources currently in use.

  2. Switch to other npm sources: You can use npm config set registry to switch to other npm sources, which you can substitute yourself.

  3. and use npm cache clean --force to clear the cache before installing the package.

  4. Install the package again: then use the npm i command to install the package.

If the above steps do not solve the problem, you can try using the cnpm command to install the package. The cnpm command is based on npm. The only difference is that cnpm uses the domestic npm source by default, so using cnpm will have a faster download speed. The specific method is also very simple, you just need to replace npm with cnpm, for example npm install xxx with cnpm install xxx .
If the answer is helpful, please accept it.

dqxiaoying 注册会员
2023-02-25 10:16

the reference answer GPT ᴼ ᴾ ᴱ ᴺ ᴬ ᴵ < br / > the error code 451 indicates the server refused the request, usually because caused by permission problems. In this case, you may be on a restricted network or accessing resources that require authentication.
-
For this problem you are experiencing, it is recommended that you check your network environment for access restrictions and ensure that you have the correct certificates installed on your computer. You can try using a VPN or other network environment for access to see if the problem can be resolved.
-
Alternatively, you can try to clear npm's cache and reinstall the dependency package. You can clear the cache using the following command:

npm cache clean --force

Then run npm i to install the dependency package. If the problem persists, try removing the node_modules directory and package-lock.json file before reinstalling the dependency packages.