背景:新项目开发,mac第一次使用。
问题1
一脸懵逼,npm install 的时候总是到某个包卡死。开始以为是网速问题。等待了很久,依然没有进度。然后尝试挂上代理,依然卡死。
各种百度,最后发现
ssh-add ~/.ssh/id_rsa
这个命令贼好用。同时也解决了git clone输入密码的问题
问题2
解决了上边的问题后,继续npm install 结果卡到了node-sass
Error: EACCES: permission denied, mkdir '/project/shopAdmin_rightmanage/node_modules/node-sass/build'
....
npm ERR! Failed at the node-sass@4.12.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
百度搜索是权限问题,但是明明使用的是
sudo npm install
怎么还有权限问题,奇怪了。
百度各种文章后,看到这这个命令
sudo npm install --unsafe-perm=true --allow-root
一条命令解决。