Topic on Talk:Parsoid

Parsoid Install Error: Depends: nodejs (>= 4.0.0) [Node.js v8.9.3 all ready installed]

8
Summary last edited by Arlolra 21:16, 23 December 2017 6 years ago

Use dpkg --ignore-depends=nodejs

Faddahwolf (talkcontribs)

Hello,

I am getting an error when I try and install Parsoid for the Extension:VisualEdiotor on MediaWiki in a "Debian GNU/Linux 8 \n \l" Docker container.

I know this issue has been reported elsewhere, like on this Talk:Parasoid page, but my situation is slightly different.

My set-up -

Computer - Mac Pro, 3.5 GHz 6-Core Intel Xeon E5, 16 GB 1866 MHz DDR RAM, Mac OS High Sierra 10.13.2 (17C88).

Docker - v17.09.1-ce-mac42

Docker images used - MediaWiki: https://hub.docker.com/_/mediawiki/ & MariaDB: https://hub.docker.com/_/mariadb/

After spinning up the Docker container for MariaDB, i linked it to the MediaWiki container doing —

$ docker run -it --name docker-mediawiki-node --link mediawiki-mariadb:mysql -p 9000:80 -d mediawiki

...That all works fine and I'm able to go in and complete the MediaWiki installation and connection to the MariaDB, I get the downloaded, completed  LocalSettings.php, which I copy up to the correct directory on my Docker container, that all runs fine and my Docker Test MediaWiki for a client works fine.

I then started following the instructions for the installation of the Extension:VisualEditor here. That all went fine as far as downloading the Extension, adding it to the right place in my Docker container, and editing the   LocalSettings.php which went fine. The problem started the Parsoid install, linked to from that Extension:Visual Editor page.

I got to the step where I did in my MediaWiki Docker container command line —

$ apt-get install parsoid
   Reading package lists... Done
   Building dependency tree       
   Reading state information... Done
   Some packages could not be installed. This may mean that you have
   requested an impossible situation or if you are using the unstable
   distribution that some required packages have not yet been created
   or been moved out of Incoming.
   The following information may help to resolve the situation:
   
   The following packages have unmet dependencies:
    parsoid : Depends: nodejs (>= 4.0.0) but it is not going to be installed
   E: Unable to correct problems, you have held broken packages.

Now as I've said above, I'm aware of others who have run into this error and their solutions are to install Node.js using apt-get.

The things is: I already had installed Node.js using the binaries from from the Node.JS site. I installed it successfully using these instructions here, prior to installing Extension:VisualEditor and attempting to install Parsoid.

I prefer this method because: a) I already know how to quickly install Node.js on Linux systems quickly; b) the apt-get install of Node.js installs it as $ nodejs, which as a long time Node.js coder, I simply hate. Yes, I all ready know you can fake out the system to have it "appear" as $ node from the command line, but I prefer to have it the way Node.js intended it from the get-go.

My Node.js is seen fine and works in the Docker container Debian Linux system just fine —

$ node -v
  v8.9.3
  $ npm version
  { npm: '5.6.0',
    ares: '1.10.1-DEV',
    cldr: '31.0.1',
    http_parser: '2.7.0',
    icu: '59.1',
    modules: '57',
    nghttp2: '1.25.0',
    node: '8.9.3',
    openssl: '1.0.2n',
    tz: '2017b',
    unicode: '9.0',
    uv: '1.15.0',
    v8: '6.1.534.48',
    zlib: '1.2.11' }

...as you can see. I'm running Node.js v8.9.3, the current long term supported version, which is a far greater version of then the Depends: nodejs (>= 4.0.0) that the apt-get installer for Parsoid says it requires. So I'm wondering then, why can't my Parsoid install via apt-get and why doesn't it see that Node.js is all ready installed?

Any help here with this issue would be greatly appreciated. Thank you in advance to anyone who responds with hep.

best,

— faddah portland, oregon, u.s.a.

Arlolra (talkcontribs)

The issue is with your package manager (apt), not Parsoid per se. Maybe try,

apt-get install --nodeps parsoid

Faddahwolf (talkcontribs)

Thank you, Arlolra, for responding and giving it a go. However, that didn't do it.

I tried both of these, and here was the result —

$ apt-get install --nodeps gcc
 E: Command line option --nodeps is not understood

and...

$ apt-get install --nodejs gcc
 E: Command line option --nodejs is not understood

So neither one of those worked. is there another version of this with install i'm supposed to use? Please advise. And thank you again for the help.

best,

— faddah

porltand, oregon, u.s.a.

Arlolra (talkcontribs)

Alrighty, try,

apt-get download parsoid dpkg -i --ignore-depends=nodejs parsoid.deb

Faddahwolf (talkcontribs)

Hi Arlolra,

I do appreciate your continued attempts at assistance.

I am afraid, how ever, there is no `-i` option switch for `apt-get`. When I attempt to run that at the command line, I get in Debian 8 bash —

$ apt-get download parsoid dpkg -i --ignore-depends=nodejs parsoid.deb                       
 E: Command line option 'i' [from -i] is not known.

Here is the `man` page print out of `apt-get download --help` —

$ apt-get download --help
    apt 1.0.9.8.4 for amd64 compiled on Dec 11 2016 09:48:19
    Usage: apt-get [options] command
           apt-get [options] install|remove pkg1 [pkg2 ...]
           apt-get [options] source pkg1 [pkg2 ...]
    
    apt-get is a simple command line interface for downloading and
    installing packages. The most frequently used commands are update
    and install.
    
    Commands:
       update - Retrieve new lists of packages
       upgrade - Perform an upgrade
       install - Install new packages (pkg is libc6 not libc6.deb)
       remove - Remove packages
       autoremove - Remove automatically all unused packages
       purge - Remove packages and config files
       source - Download source archives
       build-dep - Configure build-dependencies for source packages
       dist-upgrade - Distribution upgrade, see apt-get(8)
       dselect-upgrade - Follow dselect selections
       clean - Erase downloaded archive files
       autoclean - Erase old downloaded archive files
       check - Verify that there are no broken dependencies
       changelog - Download and display the changelog for the given package
       download - Download the binary package into the current directory
    
    Options:
      -h  This help text.
      -q  Loggable output - no progress indicator
      -qq No output except for errors
      -d  Download only - do NOT install or unpack archives
      -s  No-act. Perform ordering simulation
      -y  Assume Yes to all queries and do not prompt
      -f  Attempt to correct a system with broken dependencies in place
      -m  Attempt to continue if archives are unlocatable
      -u  Show a list of upgraded packages as well
      -b  Build the source package after fetching it
      -V  Show verbose version numbers
      -c=? Read this configuration file
      -o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp
    See the apt-get(8), sources.list(5) and apt.conf(5) manual
    pages for more information and options.
                           This APT has Super Cow Powers.

...so which option switch were you trying to use? Thank you again for helping out.

best,

— faddah portland, oregon, u.s.a.

Arlolra (talkcontribs)

Sorry, that was a formatting error. It should have been two separate commands.

apt-get download parsoid

dpkg -i --ignore-depends=nodejs parsoid.deb

Faddahwolf (talkcontribs)

Hi again, Arloira,

That did it! Thank you for sticking with me and giving me help all the way through this.

Actually, I found as I was installing each package, that they all had dependencies that needed installing prior to installing the others. With each, because of these reoccurring dependency errors, I had to do the —

$ apt-get install init-system-helpers

...and then —

$ dpkg -i --ignore-depends=nodejs init-system-helpers_1.22_all.deb

...to get the installs to work. The dependency packages needed to be installed this way in this particular order —

  1. init-system-helpers
  2. cron
  3. libpopt0
  4. logroatate
  5. parsoid

But in any case, it's all installed now and I can go on with the rest of Node.JS and the Extension:VideoEditor install. Thank you for the patient hand-holding of me through all this. Now I know what it takes.

A couple things — it would seem to me that this parsoid deb package has two main problems —

  1. It has four packages whose dependencies must be installed first to the package, so it would be much better if these dependencies were checked on install, and, if any are not there, then are installed, in this particular order —
    1. init-system-helpers
    2. cron
    3. libpopt0
    4. logroatate
  2. The nodejs dependency issues is happening because this package is only looking for the Node.js when it is installed via the Debian/Ubuntu apt-get *.deb package process, which, because of a conflict with another Debian Linux app all ready called "node," installs it as `nodejs` on linux systems, which is non-standard, and frankly, annoying to JavaScript/Node.js programmers. The dependency check should look to see if it was installed using `apt-get` or also the standard ways from the nodejs.org site — by a linux binary package or compiled from source. It should be checking for either install, whether it produces a binary that is `nodejs` or `node`. this can be done with a simple `if` statement with an OR, as such —
if [ "$which nodejs" || "$which node" ]; then
   # code to install parsoid
   ...
   ...
 fi

...or something like that.

I know from your profile that you work on the Parsoid part of the WikiMedia project. Is there some place here I can go to file bug report/feature requests on these issues with Parsoid/MediaWiki project? Please let me know and I'll be glad to put this info there and hopefully get this package updated soon so it doesn't generate support questions like this too much.

Please let me know on the above issues for this `apt-get` package for Parsoid. And thank you very much again for all the help.

best,

— faddah

  portland, oregon, u.s.a.
Arlolra (talkcontribs)