Programming VIP

Very Interesting Programming

Solve the problem of Phantom Js installation failure

The company recently migrated the front-end test server and found one during the migration process. PhantomJs Questions. There is this dependency package in the configuration file, but there is no problem in downloading dependencies locally, but after push code, phantoms installation is always reported to fail in the process of downloading dependencies on the test server.

The error information is as follows:

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

* Location is the directory address of your project on the server

PhantomJs is a virtual browser. It is mainly used for unit testing in the front-end project. Our company's front-end project does not do unit testing, so this dependency should come from the template used in the initial project creation. Just remove it directly.

However, as a qualified programmer, the direct removal of this dependence does not fundamentally solve the problem, so, of course, we have to study it. After two days of waste, we found that it was only because the server did not have the bzip2 decompression tool, just need to install it, so it is no problem and waste. Two days later, I felt like I. Q. was feeding the dog.

Back to the point, how to install bzip2?

yum install bzip2

It's OK to execute the above commands on the server. It's that simple.

Keywords: Linux yum

Added by phpMitch on Fri, 16 Aug 2019 09:19:48 +0300

Popular Keywords

  • Java - 6234
  • Python - 2579
  • Javascript - 2100
  • Database - 1608
  • Linux - 1477
  • Back-end - 1449
  • Front-end - 1432
  • Spring - 1358
  • Algorithm - 1311
  • Android - 1124
  • MySQL - 1040
  • Programming - 966
  • network - 827
  • data structure - 820
  • Attribute - 785
  • github - 646
  • Install App

DevOps, CI/CD and Automation

Error during scaffolding ojet application - phantom installation failed { error: eacces: permission.

phantom installation failed error command failed

After installing the nodeJs and ojet-cli, I tried to scaffold a web application using the OJET CLI. I issued the ojet command as root. Here's what the output looks like :

[root@saasbi ojet_apps]# ojet create myFirstWebApp --template=blank:web

Processing template: blank:web

Your app structure is generated. Continuing with library install.

Performing npm install may take a bit.

Invoking npm install.

npm WARN deprecated [email protected]: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)

> [email protected] install /ojet_apps/myFirstWebApp/node_modules/phantomjs-prebuilt

> node install.js

Considering PhantomJS found at /usr/local/lib/nodejs/node-v8.11.3/bin/phantomjs

Looks like an `npm install -g`

Found PhantomJS at /usr/local/lib/nodejs/node-v8.11.3/lib/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs ...verifying

Writing location.js file

Error checking path, continuing { Error: EACCES: permission denied, open '/ojet_apps/myFirstWebApp/node_modules/phantomjs-prebuilt/lib/location.js'

     at Object.fs.openSync (fs.js:646:18)

     at Object.fs.writeFileSync (fs.js:1299:33)

     at writeLocationFile (/ojet_apps/myFirstWebApp/node_modules/phantomjs-prebuilt/lib/util.js:84:6)

     at Promise._successFn (/ojet_apps/myFirstWebApp/node_modules/phantomjs-prebuilt/install.js:366:11)

     at nextTickCallback (/ojet_apps/myFirstWebApp/node_modules/kew/kew.js:47:28)

     at _combinedTickCallback (internal/process/next_tick.js:131:7)

     at process._tickCallback (internal/process/next_tick.js:180:9)

  errno: -13,

  code: 'EACCES',

  syscall: 'open',

  path: '/ojet_apps/myFirstWebApp/node_modules/phantomjs-prebuilt/lib/location.js' }

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)

Removing /ojet_apps/myFirstWebApp/node_modules/phantomjs-prebuilt/lib/phantom

Copying extracted folder /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1529636869355/phantomjs-2.1.1-linux-x86_64 -> /ojet_apps/myFirstWebApp/node_modules/phantomjs-prebuilt/lib/phantom

Phantom installation failed { Error: EACCES: permission denied, link '/tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1529636869355/phantomjs-2.1.1-linux-x86_64' -> '/ojet_apps/myFirstWebApp/node_modules/phantomjs-prebuilt/lib/phantom'

  syscall: 'link',

  path: '/tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1529636869355/phantomjs-2.1.1-linux-x86_64',

  dest: '/ojet_apps/myFirstWebApp/node_modules/phantomjs-prebuilt/lib/phantom' } Error: EACCES: permission denied, link '/tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1529636869355/phantomjs-2.1.1-linux-x86_64' -> '/ojet_apps/myFirstWebApp/node_modules/phantomjs-prebuilt/lib/phantom'

npm WARN [email protected] requires a peer of qunitjs@* but none is installed. You must install peer dependencies yourself.

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! [email protected] install: `node install.js`

npm ERR! Exit status 1

npm ERR! Failed at the [email protected] install script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

npm ERR! /root/.npm/_logs/2018-06-22T03_07_52_062Z-debug.log

Error: (during Invoking npm install.) 1

Attaching the 2018-06-22T03_07_52_062Z-debug.log

Not sure what to do here. Any suggestions?

Fix phantomjs-prebuilt install for npm 5

  • Review changes
  • Check out branch
  • Pipelines 1

This error happens when installing phantomjs-prebuilt on npm 5:

According to https://github.com/Medium/phantomjs/issues/707 , this probably will not be fixed, so the workaround is:

I was going to add an item to the troubleshooting doc since it sounds "unsafe", but:

  • I would expect almost no one installing GDK will have a problem doing this since the only other solution is to downgrade npm
  • Fixing the commands directly will save people a lot of wasted time
  • We're moving to headless Chrome soon anyway
  • Suspicious people will find this MR after blaming the commit for the explanation

Merge request reports

Sonar-scanner-cli latest Docker image missing bzip2

When running sonar-scanner-cli on Gitlab CI, the setup fails while installing npm package PhantomJS with error:

This occurs in the before_script as a result of bzip2 not being available on the image.

code

This should work fine with the newest image (version 4.4 , now also tagged latest ). Please let us know if that is not the case.

解决PhantomJs安装失败的问题

phantom installation failed error command failed

公司最近要迁移前端测试服务器,在迁移过程中,发现了一个 PhantomJs 的问题。配置文件中有这个依赖包,但是在本地下载依赖的时候没有问题,但是,在push代码以后,在测试服务器上下载依赖的过程中,总是报phantoms安装失败

* 地方是自己的项目在服务器的目录地址

PhantomJs 是一个虚拟浏览器,在前端项目里主要是在做单元测试的时候用的,我们公司的前端项目并没有做单元测试,所以这个依赖应该是项目初始创建的时候用的模板里自带的,直接去掉就好了

但是,作为一个合格的程序员,直接去掉这个依赖并没有从根本上解决问题,所以,当然要研究一番了,在浪费了两天时间以后,才发现,原来只是因为 服务器没有bzip2解压工具,只需要安装一下就没问题了 这么个破问题浪费了两天的时间,瞬间感觉智商都喂了狗了…

言归正传,如何安装bzip2呢

在服务器上执行以上命令就OK了,就是这么简单

phantom installation failed error command failed

“相关推荐”对你有帮助么?

phantom installation failed error command failed

请填写红包祝福语或标题

phantom installation failed error command failed

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。 2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

phantom installation failed error command failed

  • Search Configure Global Search

Installing npm package phantomjs-prebuilt failing for WikibaseJavaScriptApi builds Closed, Resolved Public Actions

  • Edit Related Tasks...
  • Create Subtask
  • Edit Parent Tasks
  • Edit Subtasks
  • Merge Duplicates In
  • Close As Duplicate
  • Edit Related Objects...
  • Edit Commits
  • Mute Notifications
  • Protect as security issue
  • Award Token
  • Flag For Later
  • Continuous-Integration-Config (Backlog)
  • Wikidata (incoming)
  • Patch-For-Review
  • RelEng-Archive-FY201718-Q2

Description

I might be panicking and it might be just a temporary glitch. Nonetheless, I noticed today morning npm jenkins jobs for patches in extensions/WikibaseJavaScriptApi are failing. See e.g. failures for https://gerrit.wikimedia.org/r/#/c/387079 or https://gerrit.wikimedia.org/r/#/c/387773

I wonder whether this is somehow related to the recent switch to docker containers for npm jobs?

Possibly relevant part of npm-debug.log below:

64684 silly install [email protected] /src/node_modules/.staging/phantomjs-prebuilt-e66e8660 64685 info lifecycle [email protected]~install: [email protected] 64686 verbose lifecycle [email protected]~install: unsafe-perm in lifecycle true 64687 verbose lifecycle [email protected]~install: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/src/node_modules/phantomjs-prebuilt/node_modules/.bin:/src/node_modules/.bin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 64688 verbose lifecycle [email protected]~install: CWD: /src/node_modules/phantomjs-prebuilt 64689 silly lifecycle [email protected]~install: Args: [ '-c', 'node install.js' ] 64690 silly lifecycle [email protected]~install: Returned: code: 1 signal: null 64691 info lifecycle [email protected]~install: Failed to exec install script 64692 verbose unlock done using /cache/_locks/staging-1a14545af9ac12d4.lock for /src/node_modules/.staging 64693 silly rollbackFailedOptional Starting 64694 silly rollbackFailedOptional Finishing 64695 silly runTopLevelLifecycles Starting 64696 silly runTopLevelLifecycles Finishing 64700 verbose stack Error: [email protected] install: node install.js 64700 verbose stack Exit status 1 64700 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:239:16) 64700 verbose stack at emitTwo (events.js:106:13) 64700 verbose stack at EventEmitter.emit (events.js:191:7) 64700 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14) 64700 verbose stack at emitTwo (events.js:106:13) 64700 verbose stack at ChildProcess.emit (events.js:191:7) 64700 verbose stack at maybeClose (internal/child_process.js:891:16) 64700 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) 64701 verbose pkgid [email protected] 64702 verbose cwd /src 64703 error Linux 4.9.0-0.bpo.3-amd64 64704 error argv "/usr/bin/nodejs" "/usr/local/bin/npm" "install" "--no-progress" 64705 error node v6.11.0 64706 error npm v3.8.3 64707 error code ELIFECYCLE 64708 error [email protected] install: node install.js 64708 error Exit status 1 64709 error Failed at the [email protected] install script 'node install.js'. 64709 error Make sure you have the latest version of node.js and npm installed. 64709 error If you do, this is most likely a problem with the phantomjs-prebuilt package, 64709 error not with npm itself. 64709 error Tell the author that this fails on your system: 64709 error node install.js 64709 error You can get information on how to open an issue for this project with: 64709 error npm bugs phantomjs-prebuilt 64709 error Or if that isn't available, you can get their info via: 64709 error npm owner ls phantomjs-prebuilt 64709 error There is likely additional logging output above. 64710 verbose exit [ 1, true ]

Related Objects

Event timeline.

The root cause is the tarball is compressed with bzip2 and the Docker container lacks /usr/bin/bz2 .

I had a similar issue when migrating jobs to Nodepool instances, specially the job running the selenium tests ( T137112 ). From that task:

Just found out that PhantomJS 2.1.1 is available in jessie-backports since March 8th!!! https://packages.debian.org/jessie-backports/phantomjs https://gerrit.wikimedia.org/r/#/c/344613/

We should either:

A) add phantomjs to the wmfreleng/npm-test container and phantomjs-prebuilt would be able to find it. The node module dependency might have to be changed to match the Debian package version (2.1.1). https://packages.debian.org/search?keywords=phantomjs

B) create a different container that extends npm-test and would support PhantomJS / Chromium and with Xvfb. There is T179360

Other repositories that might be affected:

  • mediawiki/selenium
  • wikimedia-portals

Change 387780 had a related patch set uploaded (by Hashar; owner: Hashar): [integration/config@master] Move npm for WikibaseJavaScriptApi back to Nodepool

https://gerrit.wikimedia.org/r/387780

Change 387780 merged by jenkins-bot: [integration/config@master] Move npm for WikibaseJavaScriptApi back to Nodepool

So WikibaseJavaScriptApi is fixed now, as such this task is fixed.

Then it is all about whether we include PhantomJS in wmfreleng/npm-test or switch to a new containers ( T179360 ).

Thanks @hashar ! So could this be closed or do you want to use it for tracking making this decision?

Yup we can follow up on T179360

Ditto for data-values/value-view https://gerrit.wikimedia.org/r/#/c/388185/

Search code, repositories, users, issues, pull requests...

Provide feedback.

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly.

To see all available qualifiers, see our documentation .

  • Notifications

WSL not working because an upgrade won't finish. #11048

@hibblydictus

hibblydictus Jan 19, 2024

Beta Was this translation helpful? Give feedback.

Replies: 0 comments

@hibblydictus

  • Numbered list
  • Unordered list
  • Attach files

Select a reply

IMAGES

  1. How to fix Installation has failed error on Windows?

    phantom installation failed error command failed

  2. Windows 11 installation has failed log

    phantom installation failed error command failed

  3. How to remove a phantom/default (?) user in Windows 10

    phantom installation failed error command failed

  4. How to Fix Software Installation Error in Windows 10,8 1,7 (Fail, Fatal

    phantom installation failed error command failed

  5. Windows 10 installation has failed

    phantom installation failed error command failed

  6. Phantom installation failed TypeError [ERR_INVALID_ARG_TYPE]: The "path

    phantom installation failed error command failed

VIDEO

  1. Fatal_Error

  2. Command Failed

  3. Guys how to fix this error occurred

  4. FATAL ERROR, Please Re-Boot Error x03034x0110

  5. UPDATED REF SHEET OF 【PHANTOM ERROR METAL】

  6. A error have occurred

COMMENTS

  1. Error installing PhantomJS with NPM / NodeJS

    Tell the author that this fails on your system: [exec] npm ERR! node install.js [exec] npm ERR! You can get their info via: [exec] npm ERR! npm owner ls phantomjs [exec] npm ERR! There is likely additional logging output above. [exec] Writing location.js file [exec] npm ERR!

  2. Phantom installation failed { Error: Command failed: tar jxf /tmp

    yum install bzip2 its works 👍 16 nabajitroy, sjuksin, ebenites, hothvictor, ravinsinghd, tejas-rapidops, maynor96, emdneto, k1ch, eugeniopacceli, and 6 more reacted with thumbs up emoji 🎉 2 hothvictor and Genie77998 reacted with hooray emoji ️ 5 hothvictor, Pixelon5, Elnadrion, cyrilmarois, and Genie77998 reacted with heart emoji 🚀 1 ...

  3. Phantom installation failed TypeError: Path must be a string ...

    Phantom installation failed TypeError: Path must be a string. Received undefined #200. Open Lekensteyn opened this issue May 27, 2017 · 4 comments ... Error: Command failed: dmidecode -t system | grep Serial YN0000: │ serial-number@npm:1.3. STDERR /bin/sh: 1: dmidecode: not found YN0000: │ serial-number@npm:1.3. STDERR YN0000: │ serial ...

  4. Installation fails with npm 5 · Issue #707 · Medium/phantomjs

    npm: 5.0.1. sudo npm install -g phantomjs-prebuilt, with default NodeSource installation, sudo is needed for installing global packages. marklagendijk mentioned this issue on Jun 2, 2017. NPM5 Permissions Issue npm/npm#16896. Closed. LeSuisse added a commit to Enalean/docker-tuleap-buildsrpms that referenced this issue on Jun 7, 2017. dfadbff.

  5. Solve the problem of Phantom Js installation failure

    The company recently migrated the front-end test server and found one during the migration process. PhantomJs Questions. There is this dependency package in the configuration file, but there is no problem in downloading dependencies locally, but after push code, phantoms installation is always reported to fail in the process of downloading dependencies on the test server.

  6. Error during scaffolding OJET application

    After installing the nodeJs and ojet-cli, I tried to scaffold a web application using the OJET CLI. I issued the ojet command as root. Here's what the output looks like :[root@saasbi ojet_apps]# ojet ...

  7. Troubleshoot the Splunk Phantom App for Splunk

    To resolve the issue, add the Splunk Phantom role to whichever role is in use by the Splunk Phantom App for Splunk. If you are using release 2.5.2 or earlier of the Splunk Phantom App for Splunk, perform the following steps: In Splunk Web, navigate to Settings > Access Controls. Click Roles. Click the phantom role.

  8. Fix phantomjs-prebuilt install for npm 5

    sudo npm install [email protected] -g --unsafe-perm I was going to add an item to the troubleshooting doc since it sounds "unsafe", but: I would expect almost no one installing GDK will have a problem doing this since the only other solution is to downgrade npm

  9. Failed at the [email protected] install script 'node install.js'

    The work around I used was to get the phantomjs-2.1.1-windows.zip and copy it to the C:\Users\<username>\AppData\Local\Temp\phantomjs\phantomjs-2.1.1-windows.zip and that resolved the issue with the build script.If someone cleans the temp directory,issue will come back.

  10. Installation failed on Ubuntu 16.04 #630

    Docker container based on ubuntu 16.04 + NodeJS 6.x and NGINX Get the following error: Error extracting archive Phantom installation failed { Error: Command failed ...

  11. Sonar-scanner-cli latest Docker image missing bzip2

    Hi @Abdulwahab_Sahyoun, Welcome to the community .. This should work fine with the newest image (version 4.4, now also tagged latest).Please let us know if that is not the case. Cheers.

  12. 解决PhantomJs安装失败的问题

    PhantomJS 已经停止维护了,建议使用其他替代方案,如 Puppeteer 或 Chrome Headless。 如果你仍然需要安装 PhantomJS,但在使用 npm 安装时出现错误,可能是由于以下原因导致的: 1.网络问题:请检查你的网络连接是否正常,并确保没有被代理服务器阻止了请求。可以尝试使用其他网络或者关闭代理服务器来 ...

  13. phantom installation failed error command failed

    The command line interface is a text-only interface that is distinct from a graphical user interface. Some disadvantages of the command line interface are a steep learning curve, small room for error, the large number of commands and the in..... Are you a fan of Candy Crush Saga but struggling with installing the game on your device? Don't worry; you're not alone.

  14. Failed at the [email protected] install script 'node install.js

    Server configuration : AWS Elastic Beanstalk with 64bit Amazon Linux & Docker 1.11.2 Node : 4.0 Docker file: FROM ubuntu:14.04 FROM node:argon # Create app directory RUN mkdir -p /myapp WORKDIR /my...

  15. Installing npm package phantomjs-prebuilt failing for ...

    I might be panicking and it might be just a temporary glitch. Nonetheless, I noticed today morning npm jenkins jobs for patches in extensions/WikibaseJavaScriptApi are failing.

  16. npm install error Failed at the [email protected] install script

    Failed at the [email protected] install script. npm ERR! This is most likely a problem with the phantomjs package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node install.js npm ERR! You can get their info via: npm ERR! npm owner ls phantomjs npm ERR! There is likely additional logging output ...

  17. Have an installation problem? Check here.

    For Foxit PDF Reader. 1) Open Registry Editor; 2) Go to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall, locate Foxit Reader_is, right click on it and choose Delete to delete it. Installation Situations Solutions If you meet one of the following installation situations: The cabinet file 'media1.cab' required...

  18. Jenkins cannot install phantomjs · Issue #615

    Failed at the [email protected] install script 'node install.js'. npm ERR! This is most likely a problem with the phantomjs package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR!

  19. Failed to download pecl/ZendOpcache

    Hello i m getting and error while trying install ZendOPcache from WHM " Software " Module Installers Failed to download...

  20. Error with PhantomJS when installing Highcharts export server on Azure

    I'm trying to install the Highcharts export server on a new Azure VM that runs on Ubuntu 20.04. I've installed node.js and npm, and when I try to run the npm install command: sudo npm install highcharts-export-server -g I get the following error:

  21. PhantomJS not found on PATH

    You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window.

  22. WSL not working because an upgrade won't finish. #11048

    You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window.

  23. TeamCity Cannot exec: No such file or directory

    It's "technically" working, but I can't run a successful build because of some minor issues I think might be related to setting up the server. The first problem I had was regarding npm, I tried to run the command line npm and it wouldn't work. I fixed that by installing the Node.js NPM plugin for teamcity. Now the problem is related to bzip2 ...