Mac unsupported architecture

(Melons are the sweetest when grown in nutritious manure, and geniuses are the best when grown in vicious soil. - Bacon)

insert image description here

unsupported architecture

Such problems are prone to occur in the m-series chips of mac, because the m-series is the chip architecture of arm64, and the chip architecture of some nodejs versions or npm packages is x86, so such problems occur frequently, but with the new version of
nodejs With the support of m-series chips, npm ecological toolkits are gradually compatible with the arm64 architecture, but some older ones are not compatible, and this problem still occurs. The only solution is to use a package compatible with the arm64 architecture or use a newer nodejs Version

problem scenario

After switching from a windows computer to a mac, such problems occurred when starting the nodejs service, but nodejs uses version 14, which already supports the m-series chips of the mac, so I started to troubleshoot the problem of the npm package

  • First execute the js file without any dependencies, and find that it can be started normally, then you can be sure that it must be a problem with the npm package
  • Under the traditional http service, first check each control layer (controller), and only enable one controller at a time to narrow the scope
  • After locating the problematic control layer, start to check the business layer (service), and only enable one service at a time to narrow the scope
  • After locating the problematic business layer, start to check the package dependencies of the business layer, and only enable one package at a time to narrow the scope
  • Finally, locate the problematic npm package, and find the solution (upgrade version or other) of the package in npm or github. If the problem of the package cannot be solved, use other packages that support the arm64 architecture to solve it.
ffprobe-static

For example, version 3.0.0 of this package does not support arm64 chips, and it will be resolved after upgrading to 3.1.0

Guess you like

Origin blog.csdn.net/qq_42427109/article/details/132134244