connect ECONNREFUSED 151.101.0.133:443 | spawn xxx ENOENT

Hello everyone:
    I am a roast duck. Today I share a problem with the node project packaging failure.


1. Recurring problems
 


The packaging of the node project has always failed before. There is no problem with the test environment's jenkins, and there are problems with production. Basically, you can rule out problems at the code level.
The error message is shown in the figure. In addition, there is a connect ECONNREFUSED XXX, and the packaging has not stopped, indicating that it is not a failure caused by this problem (Error).




 

2. Guess the source of the problem


Guess it may be caused by environmental issues, inconsistent Linux server systems, or inconsistent node versions, or what is special about the mozjpeg package.
Quality colleagues feedback that this is because of code problems, skip testing and packaging:

mozjpeg pre-build test failed

I really don't know how to skip this, because the test environment is ok, and this is not printed, the same command and script.

Later, I looked at the log carefully and found that the error was related to several directories.

 ./node_modules/image-webpack-loader
  node_modules/mozjpeg/vendor
  node_modules/optipng-bin/vendor/optipng

Later, the test environment was packaged with the node-modules of Jenkins. These directories were compared with the production, and a little problem was found.
The node_modules / optipng-bin directory differs from the vendor directory in production and testing.

3. Solutions

Copy the tested vendor directory to the corresponding directory where the production jenkins packaged npm generates node-modules. It is suspected that the link fails when npm causes the download package to fail (the file is missing)

This kind of problem is not very easy to find the cause, even if it is found, it is not very easy to solve. You can't manually copy the package to the production environment every time you add the package. Let's count it as a temporary solution.

 

 

Published 119 original articles · 59 praises · 230,000 views +

Guess you like

Origin blog.csdn.net/Angry_Mills/article/details/105476600