Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation failed due PhantomJS #161

Closed
aik099 opened this issue Aug 10, 2018 · 10 comments
Closed

Installation failed due PhantomJS #161

aik099 opened this issue Aug 10, 2018 · 10 comments

Comments

@aik099
Copy link

aik099 commented Aug 10, 2018

Expected behaviour

Running npm install highcharts-export-server -g command won't end up in error.

Actual behaviour

Running npm install highcharts-export-server -g command fails (if I remove -g flag, then it works, but I need it globally installed of course):

→ npm install highcharts-export-server -g          
/usr/local/bin/highcharts-export-server -> /usr/local/lib/node_modules/highcharts-export-server/bin/cli.js

> phantomjs-prebuilt@2.1.14 install /usr/local/lib/node_modules/highcharts-export-server/node_modules/phantomjs-prebuilt
> node install.js

Considering PhantomJS found at /usr/local/bin/phantomjs
Found PhantomJS at /usr/local/bin/phantomjs ...verifying
Writing location.js file
Error checking path, continuing { Error: EACCES: permission denied, open '/usr/local/lib/node_modules/highcharts-export-server/node_modules/phantomjs-prebuilt/lib/location.js'
    at Object.fs.openSync (fs.js:652:18)
    at Object.fs.writeFileSync (fs.js:1299:33)
    at writeLocationFile (/usr/local/lib/node_modules/highcharts-export-server/node_modules/phantomjs-prebuilt/lib/util.js:84:6)
    at Promise._successFn (/usr/local/lib/node_modules/highcharts-export-server/node_modules/phantomjs-prebuilt/install.js:375:11)
    at nextTickCallback (/usr/local/lib/node_modules/highcharts-export-server/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: '/usr/local/lib/node_modules/highcharts-export-server/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 /usr/local/lib/node_modules/highcharts-export-server/node_modules/phantomjs-prebuilt/lib/phantom
Copying extracted folder /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1533892810919/phantomjs-2.1.1-linux-x86_64 -> /usr/local/lib/node_modules/highcharts-export-server/node_modules/phantomjs-prebuilt/lib/phantom
chmod failed: phantomjs was not successfully copied to /usr/local/lib/node_modules/highcharts-export-server/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! phantomjs-prebuilt@2.1.14 install: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the phantomjs-prebuilt@2.1.14 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-08-10T09_20_17_049Z-debug.log
root at prod-mbp in /tmp/phantomjs

Reproduction steps

The /usr/local/lib/node_modules/highcharts-export-server/node_modules/phantomjs-prebuilt/lib folder was supposed to be created somewhere the middle of installation, but it didn't and therefore attempt to write location.js file for testing in there failed.

I have PhantomJS present in /usr/local/bin, but even if it was missing the issue would still happen. At the moment when location.js is to be copied the /usr/local/lib/node_modules/highcharts-export-server folder is also missing.

  • NodeJS: 8.4.0
  • NPM: 5.3.0

I can't upgrade unfortunately.

@ratmav
Copy link

ratmav commented Aug 30, 2018

i ran into this recently on centos 7 using node 8x lts and the most recent version of highcharts from npm . for anyone else that needs to work around it, i installed highcharts-export-server w/o the global flag, manually moved the install to /usr/lib/node_modules where the other global packages are on the system, then symlinked /usr/lib/node_modules/highcharts-export-server/bin/cli.js to /usr/bin/highcharts-export-server.

@aik099
Copy link
Author

aik099 commented Aug 30, 2018

@ratmav , using that approach gives me this error, when I try to run the server:

module.js:491
    throw err;
    ^

Error: Cannot find module 'colors'
    at Function.Module._resolveFilename (module.js:489:15)
    at Function.Module._load (module.js:439:25)
    at Module.require (module.js:517:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/highcharts-export-server/lib/index.js:28:1)
    at Module._compile (module.js:573:30)
    at Object.Module._extensions..js (module.js:584:10)
    at Module.load (module.js:507:32)
    at tryModuleLoad (module.js:470:12)
    at Function.Module._load (module.js:462:3)

@ratmav
Copy link

ratmav commented Aug 30, 2018

haven't run into that yet, but i probably will once i get to that point. it's probably some symlink/path thing. if i run into it and find a fix before you do, i'll let you know.

@aik099
Copy link
Author

aik099 commented Aug 30, 2018

After inspecting node_modules folder I've found, that:

  • when you install package globally, then what you'll have in /usr/lib/node_modules/package-name folder and all required packages (e.g. colors) are installed in /usr/lib/node_modules/package-name/node_modules sub-folder
  • when you install package locally, then all required packages are installed in same project_name/node_modules folder, where main package is installed and not a sub-folder

That explains the error I've got. You're likely to have lots of packages installed globally.

@ratmav
Copy link

ratmav commented Aug 30, 2018

yeah, you have to copy all the dependencies as well as the top level highcharts package. pretty sure that's what the -g flag is doing anyway.

@aik099
Copy link
Author

aik099 commented Aug 30, 2018

The workaround is this:

  1. run npm install -g highcharts-export-server --ignore-scripts (avoids install scripts, that fail)
  2. run install scripts by hand (replace /usr/local/lib/node_modules with actual path where global NodeJS modules are located):
  • run node install.js in /usr/local/lib/node_modules/highcharts-export-server/node_modules/phantomjs-prebuilt folder (creates location.js file, that failed to create initially)
  • run node build.js in /usr/local/lib/node_modules/highcharts-export-server folder (configures HighCharts export server)

@vincent-dm
Copy link

I got past the error by installing tar and bzip2:
yum install -y tar bzip2

@marbetschar
Copy link

marbetschar commented May 8, 2019

Installation also fails on CentOS Linux release 7.6.1810 (Core) due to some phantomjs weirdness:

# npm install highcharts-export-server -g
npm WARN deprecated hawk@3.1.3: This version has been deprecated. Please upgrade to the latest version to get the best features, bug fixes, and security patches.
npm WARN deprecated sntp@1.0.9: This version has been deprecated. Please upgrade to the latest version to get the best features, bug fixes, and security patches.
npm WARN deprecated cryptiles@2.0.5: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated boom@2.10.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated hoek@2.16.3: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
/usr/bin/highcharts-export-server -> /usr/lib/node_modules/highcharts-export-server/bin/cli.js

> phantomjs-prebuilt@2.1.14 install /usr/lib/node_modules/highcharts-export-server/node_modules/phantomjs-prebuilt
> node install.js

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)
Removing /usr/lib/node_modules/highcharts-export-server/node_modules/phantomjs-prebuilt/lib/phantom
Copying extracted folder /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1557307074723/phantomjs-2.1.1-linux-x86_64 -> /usr/lib/node_modules/highcharts-export-server/node_modules/phantomjs-prebuilt/lib/phantom
chmod failed: phantomjs was not successfully copied to /usr/lib/node_modules/highcharts-export-server/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! phantomjs-prebuilt@2.1.14 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phantomjs-prebuilt@2.1.14 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/2019-05-08T09_17_57_007Z-debug.log

This is what the debug log says:

2019-05-08T09_17_57_007Z-debug.log

UPDATE: Suggested workaround from @aik099 works. Here's what's needed on CentOS v7 (as root):

$ npm install -g highcharts-export-server --ignore-scripts
$ cd /usr/lib/node_modules/highcharts-export-server/node_modules/phantomjs-prebuilt/
$ node install.js
$ cd /usr/lib/node_modules/highcharts-export-server
$ node build.js

@Pascal76
Copy link

On my almalinux 8.5:

node build.js
LIBERTY LIBERTY LIBERTY
LIBERTY LIBERTY LIBERTY
LIBERTY LIBERTY LIBERTY
! H|H|H|H|H H__________________________________ H|§|§|§|H H|* * * * * |---------------------| H|§|∞|§|H H| * * * * * |---------------------| H|§|§|§|H H| * * * * *|---------------------| H|H|H|H|H H| * * * * * |---------------------| H|H|H|H|H H|---------------------------------| =============== H|---------------------------------| /| _ _ | H|---------------------------------| (| O O |) H|---------------------------------| /| U | H----------------------------------- | =/ | H .../ H |I/| H /| H |/ H / / / H | | | / | H | ||o|| | H | | ||o|| | | H | | ||o|| | | H Carl Pilcher
tͪ͑̏ͯ͋̂̈ͬ̅́̈͂̄̾ ҉̠̤̻̣͕͚̘͖̤̺̜̩̳̯͜͜�s̶̷̒͑ͬ̓ͨ̈͒ͦ̂ͤ̍̇͌͆̌ͪ̐͘����gͮ͌ͪͫ̋̿͐̓̀͒̚̚͘��t̶͚̯̰̗̜̺͈͓̼̭͍̠̊ͣͦ̔̋̍̏̄͌ͬͮ̀͢͝eͤ͒̇ͫ��������ȅͩ̃ͤ̍̆͛̅ͬ̓ͩͩ̕���ì̡̛͓̘̼̮̤̜̺͌ͬͫ̉̓̂ͭ͑̈ͣ̌̊ͮ̆̓̌n̾̿ͬͧ̓̔̈ͬ̎ͤ͐̋̓̑̉�� ̿̏̉̎̐̑̈ͨ ҉�tͮ̍ͯ̓̀̊͐ͨ̊̓ͯ̅ͯͯ̋ͭ̚͢��s̗͖̲̗̜̤̥͊ͥͪͩ̈͑̇ͪ̓̅͌̐̍͊̀ͫ̏̕͟͞t̋̂̎̄͌́͆̑ͪ̇ͬ̾͟���� ̶̻̗̣̥̰͉͚̮͙̿̓͋͊̌ͨ̈͢ť̯̠̩̩̥̒̿̋ͬͩ̓̄̀ͯ̀ͬ̕͜͟e̟̫͉̼̗̰̪͊͑͐ͫ̂̾̀͘͢͟͢ş̖̮̣̬͎͍̗̦̫̼̭̠̤̩ͬ͑ͭ̈ͬͧͦ́́͑̋ͤ̒͘͝ͅ��ǹ̸̶̲͍̳̞̯̘̰͉͇̮̟̖̲͂ͬ̊͡� ̡̼̮̤̱̺͉̼͉̖̮̞̹̒̏̇͌̌̉͐̈͋̈̈ͣ̍̿͆͢͡ͅt̴͎̰̝͈̦̎͗ͤ̌̂̆̆͆̆̓͒̀͢͞͠e̷̶̳̬̭͇̜̲͖̤̦̫̗͇̫͙͚̤ͩͩ̃ͦ̚s̵͎͍͈̩̖͈͎̰͓͇̻͓̭̱̖̗̃̑ͮ͌̑̈ͧͦ̐̄̚̕������ė̢͋͐͊͛͟�����g̿ͨ̎̒͆̈͆̈̎͐ͩ̎̿ͤ̔ͦ̏̽�
������g̐ͤ̈ͪ̿ͪͧ͋���e̸̶͍̮͉̫̻̟ͯ̅̒ͫ͆̄̾͢������ṱ̸̳̳̻̱͇̬͓̯͔͚̑̿ͥͭ͞����n̡͎̤̲̠͍̲͈̭̋̅ͨ͂͆̿̇̀̓́͘g̴̸̜̘͉̘̖̹͓̝̯̻̞͇̥̫̼̭̳̯͈̠̙̞̓͒̈̾́͞ ̷ͬ͂̋̍͛ͣͣ̈͑̔̆ͪ͋̅ͧ̎̂͘ ҉̶̮̘̙͓͈͇͖͍̀ͅ��s̏̀̽͂̏̐̽̿ͭ́͂̾͊̊̉̚����� ̨͔̣̙͓̇͛̐ͫ͐ͬͭ̅̐͞ṭ̸̡̰͓̖̦͍͓̺̱̗͕͉͚̗̮̼̪̓ͨ̈̌͜͢͡e̢̧̧͎͚͕̦̯͕ͥͮ̄ͥ͗̀̚���n̎ͣ̓̑̎̑͛̆ͩ̍ͪͧͮ͊ͤ̽̈̚���ţ̴ͥ̊̐̊ͫ̇̑͆ͨ̏͐͑̒̐̍̕ ҉̭̖̹͓̬͍̭̬̮̗̺̮̣͘e̶͎̩͖͖̥͙͍͙̤͔̳̜̞̣ͣ̐̓͆ͥ̿ͨ͌ͨͬͮͬ̈͠�t̏͒͊͆̄ͯ̚������eͬ̌̍̂̂ͬ͝�s̎̅ͤ̇ ҉̷̶̙̩̗̦̪̞̯̠͎̩͔̠̺̕��n̷̶̢̯͚̣̥̣̤̦̋̔̓͛͐ǵ̷ͫ̃ͯ̓́̐͐̄�
t̡̧ͯ̾͆͒̕͡ ҉̻̗̲͙͖̗̟ͅȩ̶̡̙̤̦̲̩̼͓̥̭̈ͫ̋́́̐ͪ̇̿ͤ͑̃̚̚̕������tͥ̇̇̓̀�����n͖͖̜̬ͭ̽̅̀ͩ̏́̕͝ǵ̑̃͐̑̾͛́͘͝����s̴͔̲̲̰̪̼ͭ̈̀͂̽̇̽̿̋͑̓ͤ̿͊̓͠t̵ͥͤ́̇̾̅͂̽͑ ҉͔̮̩͍͇̟̺̲̭̗͚̥̤͚͕̮��� ̂ͣ͑̔ͪ̍̾̈̚ ҉̹̻̠͕̰̰̼͍̜̼̘͍͢ͅͅ�e̶̵̘̖͚̠̟̼͕̻̥̜͊ͬ́̏ͦ̈͊̋̂̓͑ͬ̿͑̉ͨ̀͠ͅş̷̗̩̰̻̹̙̟̭̻̺̓́͒̿ͯͮ͑̌ͮ̔̈́̚͝ͅͅ�����t̸͎̙̹̤̠̂̔ͬ̽̇ͣͭ͛̿͗̎̇̿ͪ̓͌̊̀̚̕͢ͅ���i̶̴͒ͩͯ͒̀͂ ҉̱̪̩͓͍̼̮͇͙̣�� ̵̸͍̬͖͔͓̤͈̘̯̼͉̣͇̱̅͆̇̽͌͗́͘ͅţ̢̛̍̉ͤ̄̐͆ͩͯ̌̇͛͐́��š̽ͮ̅̕͢��į̴̎ͯ͋̐̈̕������ṣ̵̨̮͖̬̃͛ͬͫ̅ͣͭ̅̐̐͛t̎ͩ̋ͣ͆̿̃ͦ̔ͤ͒͊͐̽̏͛͌̌ ҉��n̸̴͂͆̏̈͆͐̀̚��
��s̵̳͙̤̞̤̯ͣ͊ͭ̽̒͠ͅṫ̸̴̥͈͚̝̖̞̜̭͖̳̩̲̫͙͓̥̫̠̥̹̈̊͑͘͠ͅͅ��� ̷͌͂ͣ̿̑̂̔̑ͬ͊ͮ̓̈͝ ҉̫̗̮͙�e̷̷̡͈̭͖͎̲̬̮ͫͭͭ͂̔́ͫ͆ͬͥ̊̄̌͒ͩ̍̀͘�t̨̧̞̹̲̹̎̋͛ͯ̎ͭ̏̊̎ͮ̔̆̄̑̄i̗͇͕̙̱̣̳͔̻̻̱͂͌̿ͫͣ̍ͥ̍͠͞ͅň͌̄̑̚̚͝�g̨̖̻͇̮͎̘̘͖̹̥͕̖̝̞̭̥͔ͪ̓̐ͫͥͥ̓̚͘͝��eͣ̿ͥͭͬ́͑ͣ̓ͨ́ͦ́͠ ҉�sͧ̒͊̉̇̉̄̓͞ ҉̨̦̦̰͉̮̞̱̙̯̞͈̫̣̖̼̲̻͔̟̣͕̱̥͢ṫ͑͐ͪͤͥ̄ͤ̽ͫ̄́̅͑ͯ̃̚ ҉͍̹͚̥͈̤̙͉̮͚̖̲̝͉͖͝į̧ͪ͌ͤͮ͐̽͗̈͆̌̅̍̐̄̔̎ͩ̿ͦ͡ ҉͇͎͚̼̰̪̜̣̫͎͍͍�g̛̼̬̻̟̱̥̩̝̫̗̞͉̥͍̳͍̪ͮ̃̅́̀̚����t̸̴̬̖̳̭̦̻̰̥̣̍̀ͪ̏͌̇́ͮ̾ͬ͌̑̑����t̯̪͕̻̙͕̖͓̺̦̹̹ͦͧ̽ͪ̏͆̑̿̈̄ͯ̕͟͟�s̴ͭ͌̈̿̊ͫ���n͐͛̒̒̔̈ ҉ ҉̶̷̣̼̬͕͚̰̘̰̱̬̞̲͖͙̪̗̥͓͚͎̠̗̬͠��t̛̩͍͕͇͗ͬ͑̄͋̇̚͟͞��t̵̸̥̺̣̞̋̐͑ͩ͗̂͐̾̄͗��g̑̄́͂͋̏ͮ̐̽̾ͮ̈ͣ̌́̇ͬͦ͟� ̧̢̣̝͈̞̗͖̬͕͕̼̾̒͆ͥ͒̑ͧ̓ͭ̍̏ͭ̈ͣ́͘͠tͤ́̏̽̃̄ͦ̅͋ͭ͠ ҉̟͓̰͓͓͓͈̰̻͠͡��t̢̛͙͉̼͉̭̦̣̤̞̞̥͖̪̹̿͐̍͊͛̈̊ͤͬ̑ͦͮ̆̄̑i̸̛͋̿̿͋̽ͫͤ͗̈̉ͩ̀͆͗̉̓ͬ͒̀͘̕ ҉̻̳̖̞̻͓̣̝̟͉̭̺̝�g̷̷̢̉ͥ͆ͩͭ̋͛ͮ̀̅̈͆ͣ̏͐͊͛͋͘ ҉̜̦̮͓͈̰̮͚͍̣͖̯
����i̷̶̱̞̭̣͓̬͎͙̐ͪ͊̇̅ͩ̅̍̈̓͗͗̚͠����e̷̼͕̭͖̤ͩ̉͑̆̅ͩ̾ͯ͌̂̀ͮ͟͞͡����g̶̎ͦͫ̓ͣ̉̂͌ͮͧ͑ ҉̛̞͕̮̤͈̞̺̯̬̥̩̮̲̺̜̦̯͚͓̪̬̰�t̽̋̅̄͊ͧ̔ͮ͌̔ͩ͑�ē̸̛̞̲͓̙̱̯̪̜̘̝͖̤̏͛̎ͮͭͯͪ̚͢sͥͨ̾̾͌͒͂ͨ̿̊����ģ̸̹̤̟̜̫͉͙̗̲̜̳͉̥̪̺͇̳͈̪̩̜͙͙͕ͧ̃ͬ̿ͯ ̡͆͋͑̈ͨ̏ͮͩ̇ͯ̄͊͜͟͝ ҉̖͉̝͉̖̗̼̜̻̟̖͔̫͇̩͔̤̪̻̲͓͎̟͙͉͔̝̤͙��ś͈̻͇̲̼̺͇͖̺͍̻͚ͧ̎͆̋́̕͜ͅͅ���g̑̂͗̆̇̋̏̍̽ͩ̔̿͗̑͑ͨ̓ͣ̚͟ ҉̠̼̪͕̯̼̱̗̭͇͎̝̩̻̙͘͝ͅͅ ̵̽ͬͨ̓̀̈̓ͣ͒͑͋̄́����t̴ͭ̃̂ͮͤ̀͑̉͂̉ͬ̍͂ͯ͠ ҉̛̻̪͙͓̫͙̗̣͉̰͇́�������t̴̜̻͔̗̼̰̉̉̄̑͢͞͠��g̼̟̬̤̹̜̒̋̄͗̃̃̈͒ͭ́͜��e̢̢̊͂ͬ̉̈̊ͫ̒̑ ҉ ҉̼̜͇̼̯̹̳̭͈̭̳͠ͅ�ț̷̲̯̣̱͉̦̱̫̪̘̙̣̼̥͇̲͑̒̈̃͂͟���

@PaulDalek
Copy link
Contributor

PaulDalek commented May 27, 2022

@Pascal76 Sorry for the late reply. As for your issue, at some point there was a problem with the colors npm package where the newest version introduced the above message. From what I can see the defective version was removed from the npm registry. As for the previous problems, this won't be a case any more in the Puppeteer-based version of the export server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants