Development Tip

homebrew로 node.js 설치 문제

yourdevel 2020. 11. 29. 12:22
반응형

homebrew로 node.js 설치 문제


Homebrew와 함께 Node.js를 설치하려고합니다 (이전에 brew를 사용하지 않고 설치했으며 해당 파일을 모두 삭제 해 보았습니다). 비슷한 질문을하는 이전 질문을 살펴 봤지만 제대로 작동 할 수 없었습니다. 먼저 시도해 보았습니다 brew link node.

myusername@c126h060:~$ brew link node
Linking /usr/local/Cellar/node/0.12.6... 
Error: Could not symlink share/systemtap/tapset/node.stp
Target /usr/local/share/systemtap/tapset/node.stp
already exists. You may want to remove it:
  rm '/usr/local/share/systemtap/tapset/node.stp'

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

그리고 내가 실행 brew link --overwrite node하면 다음을 얻습니다.

myusername@c126h060:~$ brew link --overwrite node
Linking /usr/local/Cellar/node/0.12.6... 
Error: Could not symlink share/systemtap/tapset/node.stp
/usr/local/share/systemtap/tapset is not writable.

또한 brew link -n node수동으로 삭제할 파일을 찾으려고 했을 때 일부를 삭제했지만 삭제할 수없는 다음 파일이 남아 있습니다.

myusername@c126h060:~$ brew link -n node
Would link:
/usr/local/etc/bash_completion.d/npm
/usr/local/bin/node
/usr/local/include/node
/usr/local/share/man/man1/node.1
/usr/local/share/systemtap/tapset/node.stp
/usr/local/lib/dtrace/node.d

삭제하려고하면 다음과 같은 결과가 나타납니다 (이 모든 파일에 대해 동일).

myusername@c126h060:~$ rm /usr/local/etc/bash_completion.d/npm
rm: /usr/local/etc/bash_completion.d/npm: No such file or directory

어떻게해야합니까?


실제로 systemtap 디렉토리를 소유하지 않았을 수 있습니다. /usr/local/share자신을 소유자로 만들려면 다음 명령으로 이동하여 실행하십시오.

chown -R <yourusername>:<yourgroupname> systemtap

오늘 이전에이 동일한 문제를 고칠 때 /usr/locallib 디렉토리에 대해서도 동일한 작업을 수행해야했습니다.


또는 systemtap에서 소유권 및 권한을 확인하십시오.

$ ls -al /usr/local/share/systemtap/
drwxr-xr-x   3 root  wheel  102 Oct 23 18:06 .
drwxrwxr-x  15 root  wheel  510 Oct 24 20:24 ..
drwxr-xr-x   2 root  wheel   68 Oct 24 20:17 tapset

그런 다음 자신을 소유자 그룹 (이 경우 휠)에 추가합니다.

sudo dscl . append /Groups/wheel GroupMembership <username>

그런 다음 그룹 편집을 허용하도록 탭셋의 권한을 변경하십시오.

sudo chmod -R 775 /usr/local/share/systemtap/tapset/

나를 위해 일한 것 :

  1. cd /usr/local/share
  2. sudo chown -R <user>:<group> systemtap(1 & 2 /usr/local도 했음)

위의 단계는 실패했습니다. 다음 답변으로 갔다. 시도했습니다.

ls -al /usr/local/share/systemtap/ '찾을 수 없음 오류'가 발생했습니다.

그런 다음 : brew link node오류가 발생했습니다. 그래서 나는 :

  1. sudo rm -rf /usr/local/lib/node_modules
  2. brew postinstall node -v
  3. 그리고 마침내 brew link node
  4. node -v :)

그래서 기본적으로 모든 node_modules/폴더를 제거하고 모든 것을 다시 작성했습니다.


arun:~$ brew link node
Linking /usr/local/Cellar/node/0.12.6... 
Error: Could not symlink share/systemtap/tapset/node.stp
Target /usr/local/share/systemtap/tapset/node.stp
already exists. You may want to remove it:
  rm '/usr/local/share/systemtap/tapset/node.stp'

아래 명령 실행

brew postinstall node -v
brew link node 

사용자 이름을 얻고,

그룹 가져 오기 :( 둘 이상일 수 있음, 일반적으로 '관리자'임)

whoami
groups

예를 들면 다음과 같습니다.

sudo chown -R chrislee:admin /usr/local/share/systemtap/

다음 레시피가 저에게 효과적이었습니다.

  1. 그룹 휠을 추가하려면 사용자 이름을 추가하세요. sudo dscl . append /Groups/wheel GroupMembership username
  2. sudo chmod -R 775 /usr/local/share/systemtap/tapset/
  3. sudo rm -rf /usr/local/lib/node_modules
  4. brew cleanup
  5. brew link node
  6. brew uninstall --force node
  7. brew install node

Then check version with node -v and npm -v.


just add sudo in the beginning of the command npm install expo-cli --global

like sudo npm install expo-cli --global and hit enter.

hope it'll help you.

참고URL : https://stackoverflow.com/questions/31374143/trouble-install-node-js-with-homebrew

반응형