# Blog 环境初始化问题

# 1.puppeteer 安装问题

出现了 The chromium binary is not available for arm64 这个错误

1
2
3
4
5
6
7
8
9
#解决办法
1.install homebrew
2.install chromium by hand
brew install --cask eloston-chromium
3.install puppeteer and skip chromium installation
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 npm i puppeteer
4.set env path in ~/.bash_profile
export PUPPETEER_EXECUTABLE_PATH='/Applications/Chromium.app/Contents/MacOS/Chromium'
the path is the real path that you downloaded on step 2

# 2.npm install -g 全局安装 npm 包权限报错

使用 npm 安装 node 模块时报错: EACCES permissions errors
解决方式:手动更改 npm 的默认安装地址

1
2
3
4
5
6
7
8
1.create custom global npm dir
mkdir ~/.npm-global
2.config the npm to use new dir
npm config set prefix '~/.npm-global'
3.open your .bash_profile file in vim,and a line code:
export PATH=~/.npm-global/bin:$PATH
4.update system variables.
source ~/.bash_profile