node.js - 覆盖冲突文件链接node.js时出错

标签 node.js homebrew

我正在尝试通过 Homebrew 程序重新安装node.js,它已安装但未链接。当我尝试使用 brew link --overwrite node 覆盖冲突文件时,出现以下错误。有没有办法来解决这个问题? (我对此真的很陌生)

bubblenote$ brew更新&&brew安装 Node

Already up-to-date.
Warning: node 10.5.0 is already installed, it's just not linked
You can use `brew link node` to link this version.

bubblenote$ brew 链接 Node

Linking /usr/local/Cellar/node/10.5.0... 
Error: Could not symlink share/doc/node/gdbinit
Target /usr/local/share/doc/node/gdbinit
already exists. 

您可能想要删除它:

rm '/usr/local/share/doc/node/gdbinit'

强制链接并覆盖所有冲突文件:

 brew link --overwrite node

列出所有要删除的文件:

brew link --overwrite --dry-run node

bubblenote$ brew 链接 --覆盖 Node

Linking /usr/local/Cellar/node/10.5.0... 
Error: Could not symlink share/doc/node/gdbinit
/usr/local/share/doc/node is not writable.

最佳答案

Error: Could not symlink share/doc/node/gdbinit /usr/local/share/doc/node is not writable.

这似乎表明您没有对该文件的写访问权限或者该文件是只读的。

尝试手动删除该文件,如果不能,则确实您没有写入权限。如果是这种情况,请尝试使用 sudo 运行该命令,看看是否有效。

编辑: 尝试以下操作使目录可写

chmod +w <directory>

关于node.js - 覆盖冲突文件链接node.js时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50979296/

相关文章:

node.js - 在 Sails.js 中使用一个请求创建/更新多条记录

node.js - 使用 webfont 生成字体 : FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

javascript - 如何将所有格式的excel文件上传/下载到azure blob存储Nodejs服务器端

homebrew - 如何仅使用脚本创建 Homebrew 程序公式

python - "ERROR:root:code for hash md5 was not found"使用任何 hg mercurial 命令时

scala - 使用 Homebrew 软件安装 scala 2.12 mac

python - OSX 通过 brew 为 python3 安装 numpy

node.js - GET 查询缺失 : Implementing GraphQL Using Apollo On an Express Server

javascript - 我怎样才能在chartjs-node-canvas中实现chartjs-plugin-datalabels?

ruby-on-rails - 回形针找不到 imagemagick