PhantomJs 설치 실패 문제 해결

2379 단어 배우다
회사가 최근에 전방 테스트 서버를 이전하려고 하는데, 이전 과정에서 PhantomJs의 문제를 발견하였다.설정 파일에 이 의존 패키지가 있지만 로컬에서 의존을 다운로드할 때 문제가 없습니다.그러나push 코드 이후 테스트 서버에서 의존을 다운로드하는 과정에서phantoms 설치 실패를 보고합니다
오류 메시지는 다음과 같습니다.
error /***/node_modules/phantomjs-prebuilt: Command failed.
Exit code: 1
Command: node install.js
Arguments: 
Directory: /***/node_modules/phantomjs-prebuilt
Output:
PhantomJS not found on PATH
Download already available at /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
Verified checksum of previously downloaded file
Extracting tar contents (via spawned process)
Error extracting archive
Phantom installation failed { Error: Command failed: tar jxf /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
tar (child): bzip2: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now

    at ChildProcess.exithandler (child_process.js:294:12)
    at ChildProcess.emit (events.js:189:13)
    at maybeClose (internal/child_process.js:970:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
  killed: false,
  code: 2,
  signal: null,
  cmd:
   'tar jxf /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2' } Error: Command failed: tar jxf /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
tar (child): bzip2: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now

    at ChildProcess.exithandler (child_process.js:294:12)
    at ChildProcess.emit (events.js:189:13)
    at maybeClose (internal/child_process.js:970:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
ERROR: Job failed: exit status 1

4* 자신의 프로젝트가 서버에 있는 디렉터리 주소
4PhantomJs 가상 브라우저로 전방 프로젝트에서 주로 단원 테스트를 할 때 사용한다. 우리 회사의 전방 프로젝트는 단원 테스트를 하지 않기 때문에 이 의존은 프로젝트를 처음 만들 때 사용하는 템플릿에 있는 것이므로 직접 제거하면 된다.
그러나 합격한 프로그래머로서 이 의존을 직접 없애는 것은 근본적으로 문제를 해결하지 못했기 때문에 당연히 한 번 연구해야 한다. 이틀의 시간을 낭비한 후에 서버에 bzip2 압축 해제 도구가 없기 때문에 설치만 하면 문제가 없다는 것을 발견했다. 이런 낡은 문제는 이틀의 시간을 낭비했다. 순간 지능이 개에게 먹인 것 같았다.
본론으로 돌아가면 어떻게 bzip2를 설치합니까
yum install bzip2

서버에서 위 명령을 실행하면 OK입니다. 이렇게 간단합니다.

좋은 웹페이지 즐겨찾기