安装cordova踩过的坑

1. 发现安装不上,可能是之前npm与cnpm搞混了
2. 更新npm的版本(原先是node -v8.9.4 npm -v5.6.0),使用npm install @latest 后,node与npm版本不匹配。想着返回npm的版本,无法实现。删除npm,此时只有node -v,而无npm -v,更完蛋。
3. 更新node -v也无法实现,删除node也无法彻底删除。到处找彻底删除node的方法。还是删不掉。
4. 使用brew update; brew link node; brew uninstall node; brew install node
Warning: node 16.6.2 is already installed, it's just not linked.
To link this version, run:
  brew link node
5. brew link node
Linking /usr/local/Cellar/node/16.6.2... 
Error: Could not symlink bin/node
Target /usr/local/bin/node
already exists. You may want to remove it:
  rm '/usr/local/bin/node'

To force the link and overwrite all conflicting files:
  brew link --overwrite node

To list all files that would be deleted:
  brew link --overwrite --dry-run node
6. 使用rm ‘/usr/local/bin/node’;再brew link node
Error: Could not symlink include/node/common.gypi
Target /usr/local/include/node/common.gypi
already exists. You may want to remove it:
  rm '/usr/local/include/node/common.gypi'

To force the link and overwrite all conflicting files:
  brew link --overwrite node

To list all files that would be deleted:
  brew link --overwrite --dry-run node

实在解决不了。使用pip install node

7. pip install node

又不行。又使用brew install node

Warning: node 16.6.2 is already installed, it's just not linked.
To link this version, run:
  brew link node
8. brew link node
Linking /usr/local/Cellar/node/16.6.2... 
Error: Could not symlink share/systemtap/tapset/node.stp
/usr/local/share/systemtap/tapset is not writable.
9. 重点:Homebrew的/usr/local/share/… is not writable.文件权限问题

链接:https://blog.csdn.net/victor_barnett/article/details/79373413
在这里插入图片描述

10. 使用sudo chown -R whoami:admin /usr/local/share,终于好了。
Linking /usr/local/Cellar/node/16.6.2... 7 symlinks created.
11.结果发现原先一直默认的node版本没有改过来,查了一下,原来有个叫nvm的东西。使用nvm install stable,即可安装并默认使用稳定版,搞定!!

https://www.cnblogs.com/gaozejie/p/10689742.html

12. 此时就可以愉快地install cordova啦

https://www.jianshu.com/p/249d4998aa0c

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值