Linux에 Near-cli 설치
3586 단어 blockchaintutoriallinux
near-cli를 설치하려면 시스템에 Node.js 및 npm이 있어야 합니다. 배포의 리포지토리에서 직접 설치할 수 있습니다.npm install near-cli -g를 실행한 후 다음 오류가 발생했습니다.npm ERR! code 128
npm ERR! command failed
npm ERR! command git ls-remote ssh://[email protected]/ethereumjs/ethereumjs-abi.git
npm ERR! Warning: Permanently added 'github.com' (RSA) to the list of known hosts.
npm ERR! [email protected]: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
GitHub의 인증 문제였습니다. 한 가지 가능한 솔루션은 새 SSH 키를 만들어
ssh-agent 및 내 GitHub 계정에 추가하는 것입니다. 나는 그것을했지만 root 사용자로 명령을 실행하더라도 다른 오류가 발생하여 작동하지 않았습니다.npm ERR! code 128
npm ERR! command failed
npm ERR! command git clone ssh://[email protected]/ethereumjs/ethereumjs-abi.git /root/.npm/_cacache/tmp/git-clone-e04f6db7 --recurse-submodules --depth=1
npm ERR! fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-clone-e04f6db7': Permission denied
Node.js의 최신 버전이 12.22.1인 페도라 32 가상 환경에 설치
near-cli를 시도했는데 문제 없이 작동했다. Fedora 33과 Debian Buster에서 동일한 오류가 발생했습니다.해결책
Node.js 문서에 따르면 npm의 기본 디렉토리를 수동으로 변경하는 방법은 Resolving EACCES permissions errors when installing packages globally 입니다.
Node.js 및 npm을 설치한 후:
전역 설치를 위한 디렉터리를 만듭니다.
$ mkdir ~/.npm-global
새 디렉터리 경로를 사용하도록 npm을 구성합니다.
$ npm config set prefix '~/.npm-global'
~/.profile 파일을 열거나 만들고 다음 줄을 추가합니다.export PATH=~/.npm-global/bin:$PATH
시스템 변수를 업데이트하십시오.
$ source ~/.profile
이제
near-cli 없이 다음 명령을 실행하여 sudo를 설치할 수 있습니다.$ npm install near-cli -g
가도 돼! 이제 Near Academy에서 연습을 완료하는 데 필요한 도구가 있습니다.
Reference
이 문제에 관하여(Linux에 Near-cli 설치), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/mattdark/installing-near-cli-on-linux-35b1텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)