在Debian系統解決Node.js依賴問題可按以下步驟操作:
sudo apt update
sudo apt install nodejs npm
(如需特定版本,可通過NodeSource倉庫添加,參考)npm install
npm ls
查看依賴樹,檢查版本沖突。npm cache clean --force
rm -rf node_modules package-lock.json
npm install
package.json
依賴版本后重新安裝。curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
source ~/.bashrc
nvm install <版本號>
nvm use <版本號>
node-sass
需python
、make
),需手動安裝:sudo apt install python make
參考來源: