简体   繁体   English

安装节点和 npm 时出现问题

[英]Problems installing node and npm

I am trying to run the command我正在尝试运行命令

  1. brew install node

and getting the warning:并收到警告:

node 12.12.0 is already installed, it's just not linked
You can use `brew link node` to link this version.
  1. When running brew link node , I get the error运行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
  1. Next, I ran rm '/usr/local/include/node/common.gypi' and it asks接下来,我运行rm '/usr/local/include/node/common.gypi'并询问
override rw-r--r--  root/wheel for /usr/local/include/node/common.gypi?
  1. When typing y当输入 y

it says它说

rm: /usr/local/include/node/common.gypi: Permission denied

How do I fix the problem with the installation?如何解决安装问题?

Thanks谢谢

I assume that you are using Mac.我假设您使用的是 Mac。 try尝试

sudo rm: /usr/local/include/node/common.gypi

Also add node PATH to your environment variables.还将节点 PATH 添加到您的环境变量中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM