主题
安装与启动类问题
npm install -g 失败
先确认 Node.js 与 npm 可用:
bash
node -v
npm -vMac / Linux 遇到 EACCES 时,把 npm 全局目录改到用户目录。
command not found
说明全局 npm bin 目录没有加入 PATH。
检查 npm 全局目录:
bash
npm config get prefix把对应的 bin 目录加入 PATH 后重新打开终端。
Windows 脚本无法执行
以管理员身份打开 PowerShell:
powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser