M1 native does not release binary version of canvas in node15. Therefore, when you install canvas, you will automatically compile from the source code, but if you do not install the corresponding dependency, you will report an error.
Solution
arch -arm64 brew install pkg-config cairo pango jpeg giflib librsvg
Troubleshooting
Homebrew cannot be installed
If you encounter
Error: Failure while executing; `tar --extract --no-same-owner --file /Users/wenbing/Library/Caches/Homebrew/downloads/6f65cc908bca8f42eeb93f33e25d76d748a7a28f20f30f41befe472ea2a01bc5--fribidi-1.0.10.arm64_big_sur.bottle.tar.gz --directory /private/tmp/d20210618-36598-16scyl7` exited with 1. Here's the output:
tar: Error opening archive: Failed to open '/Users/wenbing/Library/Caches/Homebrew/downloads/6f65cc908bca8f42eeb93f33e25d76d748a7a28f20f30f41befe472ea2a01bc5--fribidi-1.0.10.arm64_big_sur.bottle.tar.gz'
For this kind of error reporting, you need to manually install the dependency front dependency first, and then install the module
brew install libtiff gdk-pixbuf librsvg
Node gyp could not find the header file
If your homebrew is also M1 native, then homebrew will be installed under/opt/homebrew. Brew install will be under/opt/homebrew/cell/instead of linking to/usr/local/include. When node gyp is compiled, it is still compiled with clang in essence, and the header file cannot be found, so a fatal error: 'JPEG lib. H' file not found
will be reported. The solution is to add/opt/homebrew/cell/to clang’s include path. My practice is in ~ /. Bash_ Add a line to profile
export CPLUS_INCLUDE_PATH=/opt/homebrew/include
Examination
Install
Accounting subjects
Read More:
- Solution of error reporting in PIP installation of iPhone
- Solution to node sass installation failure
- Simple solution for node sass installation failure
- Solution to error reporting during installation of xlsx style
- brew install node Error: No such file or directory @ dir_chdir Bottle installation failed
- Remove M Characters “Control M” or “^M” or “CTRL M” Characters in a UNIX file
- Python installation pysimplegui error reporting solution
- Ego planner swarm installation and error reporting solution
- MacOS WGet ‘command not found’ solution
- Error: No such keg: /usr/local/Cellar/node&install nvm&brew installation&Oh my zsh.git installation&git set alias&No bundle URL prese
- Error reporting – the project directly introduces the error reporting and solution of. SCSS file
- Unloading and installation of node and NPM of Vue Foundation
- After node.js is installed, use the instruction node version in vscode to show that it is not an external or internal instruction. The solution is as follows:
- Error in loading online pictures on billboard in cesium tainted canvas may not be loaded
- Solution to error reporting in Java @ override
- Node configuration environment variable and global installation of webapck
- Solution of project error reporting in eclipse
- Lenovo x3650 M5 installation esxi-5.5.0u3 failed to resolve circular relocation
- Solution of plugins error reporting in idea maven
- Solution to unknown internal error in StarUML installation extension