[GH-ISSUE #938] Documentation improvement: npm is not listed as a dependency in Ubuntu/Debian install instructions #581

Closed
opened 2026-03-01 14:44:44 +03:00 by kerem · 3 comments
Owner

Originally created by @myself248 on GitHub (Feb 28, 2022).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/938

Describe the bug

Npm isn't listed as a dependency, but installation fails if you don't have it.

Steps to reproduce

It's a fresh install on an Ubuntu 20.04 (dist-upgraded from 18.04) machine that's never had archivebox on it before, so the repro steps are exactly the install steps in the "package manager / apt / ubuntu/debian" section of the front page of archivebox.org.

Screenshots or log output

Installing with apt as per instructions, everything looked normal up to this npm error:


    Installing YOUTUBEDL_BINARY automatically using pip...
2021.12.17 is already installed youtube-dl

    Installing CHROME_BINARY automatically using playwright...
Chromium 98.0.4758.102 snap is already installed chromium

    Installing SINGLEFILE_BINARY, READABILITY_BINARY, MERCURY_BINARY automatically using npm...
[X] Failed to install npm packages: [Errno 2] No such file or directory: 'npm'
    Hint: Try deleting /home/user/archivebox/node_modules and running it again

There is no node_modules to delete, so that suggestion doesn't work. Finally I just ran "npm" to see if it would do anything, like maybe there's an npm version command whose output might be relevant here, and realized I didn't have npm installed:


Command 'npm' not found, but can be installed with:

sudo apt install npm

After doing that, I reran archivebox init --setup and it installed two of the three, but singlefile still fails:

 √  ARCHIVEBOX_BINARY     v0.6.2          valid     /usr/local/bin/archivebox                                                   
 √  PYTHON_BINARY         v3.8.10         valid     /usr/bin/python3.8                                                          
 √  DJANGO_BINARY         v3.1.14         valid     /usr/local/lib/python3.8/dist-packages/django/bin/django-admin.py           
 √  CURL_BINARY           v7.68.0         valid     /usr/bin/curl                                                               
 √  WGET_BINARY           v1.20.3         valid     /usr/bin/wget                                                               
 √  NODE_BINARY           v10.19.0        valid     /usr/bin/node                                                               
 X  SINGLEFILE_BINARY     ?               invalid   ./node_modules/single-file/cli/single-file                                  
 √  READABILITY_BINARY    v0.0.3          valid     ./node_modules/readability-extractor/readability-extractor                  
 √  MERCURY_BINARY        v1.0.0          valid     ./node_modules/@postlight/mercury-parser/cli.js                             
 √  GIT_BINARY            v2.25.1         valid     /usr/bin/git                                                                
 √  YOUTUBEDL_BINARY      v2021.12.17     valid     /usr/local/bin/youtube-dl                                                   
 √  CHROME_BINARY         v98.0.4758.102  valid     /snap/bin/chromium                                                          
 √  RIPGREP_BINARY        v11.0.2         valid     /usr/bin/rg         

manually running singlefile --version results in the following:

user@t460:~/archivebox/node_modules/single-file/cli$ ./single-file --version
/home/user/archivebox/node_modules/yargs/node_modules/yargs-parser/build/index.cjs:1013
        throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);
        ^

Error: yargs parser supports a minimum Node.js version of 12. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions
    at Object.<anonymous> (/home/user/archivebox/node_modules/yargs/node_modules/yargs-parser/build/index.cjs:1013:15)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/home/user/archivebox/node_modules/yargs/build/index.cjs:1:58028)
    at Module._compile (internal/modules/cjs/loader.js:778:30)

ArchiveBox version

this was taken before installing npm:

ArchiveBox v0.6.2
Cpython Linux Linux-5.4.0-100-generic-x86_64-with-glibc2.29 x86_64
IN_DOCKER=False DEBUG=False IS_TTY=True TZ=UTC SEARCH_BACKEND_ENGINE=ripgrep

[i] Dependency versions:
 √  ARCHIVEBOX_BINARY     v0.6.2          valid     /usr/local/bin/archivebox                                                   
 √  PYTHON_BINARY         v3.8.10         valid     /usr/bin/python3.8                                                          
 √  DJANGO_BINARY         v3.1.14         valid     /usr/local/lib/python3.8/dist-packages/django/bin/django-admin.py           
 √  CURL_BINARY           v7.68.0         valid     /usr/bin/curl                                                               
 √  WGET_BINARY           v1.20.3         valid     /usr/bin/wget                                                               
 √  NODE_BINARY           v10.19.0        valid     /usr/bin/node                                                               
 X  SINGLEFILE_BINARY     ?               invalid   single-file                                                                 
 X  READABILITY_BINARY    ?               invalid   readability-extractor                                                       
 X  MERCURY_BINARY        ?               invalid   mercury-parser                                                              
 √  GIT_BINARY            v2.25.1         valid     /usr/bin/git                                                                
 √  YOUTUBEDL_BINARY      v2021.12.17     valid     /usr/local/bin/youtube-dl                                                   
 √  CHROME_BINARY         v98.0.4758.102  valid     /snap/bin/chromium                                                          
 √  RIPGREP_BINARY        v11.0.2         valid     /usr/bin/rg                                                                 

[i] Source-code locations:
 √  PACKAGE_DIR           23 files        valid     /usr/local/lib/python3.8/dist-packages/archivebox                           
 √  TEMPLATES_DIR         3 files         valid     /usr/local/lib/python3.8/dist-packages/archivebox/templates                 
 -  CUSTOM_TEMPLATES_DIR  -               disabled                                                                              

[i] Secrets locations:
 -  CHROME_USER_DATA_DIR  -               disabled                                                                              
 -  COOKIES_FILE          -               disabled                                                                              

[i] Data locations:
 √  OUTPUT_DIR            8 files         valid     /home/user/archivebox                                                       
 √  SOURCES_DIR           1 files         valid     ./sources                                                                   
 √  LOGS_DIR              1 files         valid     ./logs                                                                      
 √  ARCHIVE_DIR           1 files         valid     ./archive                                                                   
 √  CONFIG_FILE           81.0 Bytes      valid     ./ArchiveBox.conf                                                           
 √  SQL_INDEX             204.0 KB        valid     ./index.sqlite3                                                             

[!] Warning: Missing 3 recommended dependencies
    ! SINGLEFILE_BINARY: single-file (unable to detect version)
      Hint: To install all packages automatically run: archivebox setup
            or to disable it and silence this warning: archivebox config --set SAVE_SINGLEFILE=False
            
    ! READABILITY_BINARY: readability-extractor (unable to detect version)
      Hint: To install all packages automatically run: archivebox setup
            or to disable it and silence this warning: archivebox config --set SAVE_READABILITY=False
            
    ! MERCURY_BINARY: mercury-parser (unable to detect version)
      Hint: To install all packages automatically run: archivebox setup
            or to disable it and silence this warning: archivebox config --set SAVE_MERCURY=False

after installing npm, and rerunning archivebox init --setup, output looks the same except readability and mercury are valid, only singlefile fails:

 X  SINGLEFILE_BINARY     ?               invalid   ./node_modules/single-file/cli/single-file                                  
 √  READABILITY_BINARY    v0.0.3          valid     ./node_modules/readability-extractor/readability-extractor                  
 √  MERCURY_BINARY        v1.0.0          valid     ./node_modules/@postlight/mercury-parser/cli.js           
Originally created by @myself248 on GitHub (Feb 28, 2022). Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/938 #### Describe the bug Npm isn't listed as a dependency, but installation fails if you don't have it. #### Steps to reproduce It's a fresh install on an Ubuntu 20.04 (dist-upgraded from 18.04) machine that's never had archivebox on it before, so the repro steps are exactly the install steps in the "package manager / apt / ubuntu/debian" section of the front page of archivebox.org. #### Screenshots or log output Installing with apt as per instructions, everything looked normal up to this npm error: ```[+] Installing enabled ArchiveBox dependencies automatically... Installing YOUTUBEDL_BINARY automatically using pip... 2021.12.17 is already installed youtube-dl Installing CHROME_BINARY automatically using playwright... Chromium 98.0.4758.102 snap is already installed chromium Installing SINGLEFILE_BINARY, READABILITY_BINARY, MERCURY_BINARY automatically using npm... [X] Failed to install npm packages: [Errno 2] No such file or directory: 'npm' Hint: Try deleting /home/user/archivebox/node_modules and running it again ``` There is no node_modules to delete, so that suggestion doesn't work. Finally I just ran "npm" to see if it would do anything, like maybe there's an npm version command whose output might be relevant here, and realized I didn't have npm installed: ```user@t460:~/archivebox$ npm Command 'npm' not found, but can be installed with: sudo apt install npm ``` After doing that, I reran archivebox init --setup and it installed two of the three, but singlefile still fails: ```i] Dependency versions: √ ARCHIVEBOX_BINARY v0.6.2 valid /usr/local/bin/archivebox √ PYTHON_BINARY v3.8.10 valid /usr/bin/python3.8 √ DJANGO_BINARY v3.1.14 valid /usr/local/lib/python3.8/dist-packages/django/bin/django-admin.py √ CURL_BINARY v7.68.0 valid /usr/bin/curl √ WGET_BINARY v1.20.3 valid /usr/bin/wget √ NODE_BINARY v10.19.0 valid /usr/bin/node X SINGLEFILE_BINARY ? invalid ./node_modules/single-file/cli/single-file √ READABILITY_BINARY v0.0.3 valid ./node_modules/readability-extractor/readability-extractor √ MERCURY_BINARY v1.0.0 valid ./node_modules/@postlight/mercury-parser/cli.js √ GIT_BINARY v2.25.1 valid /usr/bin/git √ YOUTUBEDL_BINARY v2021.12.17 valid /usr/local/bin/youtube-dl √ CHROME_BINARY v98.0.4758.102 valid /snap/bin/chromium √ RIPGREP_BINARY v11.0.2 valid /usr/bin/rg ``` manually running singlefile --version results in the following: ``` user@t460:~/archivebox/node_modules/single-file/cli$ ./single-file --version /home/user/archivebox/node_modules/yargs/node_modules/yargs-parser/build/index.cjs:1013 throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`); ^ Error: yargs parser supports a minimum Node.js version of 12. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions at Object.<anonymous> (/home/user/archivebox/node_modules/yargs/node_modules/yargs-parser/build/index.cjs:1013:15) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at Object.<anonymous> (/home/user/archivebox/node_modules/yargs/build/index.cjs:1:58028) at Module._compile (internal/modules/cjs/loader.js:778:30) ``` #### ArchiveBox version this was taken before installing npm: ```logs ArchiveBox v0.6.2 Cpython Linux Linux-5.4.0-100-generic-x86_64-with-glibc2.29 x86_64 IN_DOCKER=False DEBUG=False IS_TTY=True TZ=UTC SEARCH_BACKEND_ENGINE=ripgrep [i] Dependency versions: √ ARCHIVEBOX_BINARY v0.6.2 valid /usr/local/bin/archivebox √ PYTHON_BINARY v3.8.10 valid /usr/bin/python3.8 √ DJANGO_BINARY v3.1.14 valid /usr/local/lib/python3.8/dist-packages/django/bin/django-admin.py √ CURL_BINARY v7.68.0 valid /usr/bin/curl √ WGET_BINARY v1.20.3 valid /usr/bin/wget √ NODE_BINARY v10.19.0 valid /usr/bin/node X SINGLEFILE_BINARY ? invalid single-file X READABILITY_BINARY ? invalid readability-extractor X MERCURY_BINARY ? invalid mercury-parser √ GIT_BINARY v2.25.1 valid /usr/bin/git √ YOUTUBEDL_BINARY v2021.12.17 valid /usr/local/bin/youtube-dl √ CHROME_BINARY v98.0.4758.102 valid /snap/bin/chromium √ RIPGREP_BINARY v11.0.2 valid /usr/bin/rg [i] Source-code locations: √ PACKAGE_DIR 23 files valid /usr/local/lib/python3.8/dist-packages/archivebox √ TEMPLATES_DIR 3 files valid /usr/local/lib/python3.8/dist-packages/archivebox/templates - CUSTOM_TEMPLATES_DIR - disabled [i] Secrets locations: - CHROME_USER_DATA_DIR - disabled - COOKIES_FILE - disabled [i] Data locations: √ OUTPUT_DIR 8 files valid /home/user/archivebox √ SOURCES_DIR 1 files valid ./sources √ LOGS_DIR 1 files valid ./logs √ ARCHIVE_DIR 1 files valid ./archive √ CONFIG_FILE 81.0 Bytes valid ./ArchiveBox.conf √ SQL_INDEX 204.0 KB valid ./index.sqlite3 [!] Warning: Missing 3 recommended dependencies ! SINGLEFILE_BINARY: single-file (unable to detect version) Hint: To install all packages automatically run: archivebox setup or to disable it and silence this warning: archivebox config --set SAVE_SINGLEFILE=False ! READABILITY_BINARY: readability-extractor (unable to detect version) Hint: To install all packages automatically run: archivebox setup or to disable it and silence this warning: archivebox config --set SAVE_READABILITY=False ! MERCURY_BINARY: mercury-parser (unable to detect version) Hint: To install all packages automatically run: archivebox setup or to disable it and silence this warning: archivebox config --set SAVE_MERCURY=False ``` after installing npm, and rerunning `archivebox init --setup`, output looks the same except readability and mercury are valid, only singlefile fails: ``` X SINGLEFILE_BINARY ? invalid ./node_modules/single-file/cli/single-file √ READABILITY_BINARY v0.0.3 valid ./node_modules/readability-extractor/readability-extractor √ MERCURY_BINARY v1.0.0 valid ./node_modules/@postlight/mercury-parser/cli.js ```
Author
Owner

@pirate commented on GitHub (Mar 13, 2022):

This is somewhat expected, Ubuntu's strict version pinning for apt packages makes it so the default npm install is too old to run the newest single-file version. You have to choose, do you want a newer node install and the latest and greatest single-file (add the apt repo for the latest node.js versions), or the old node + old singlefile (install them manually).

I can add a workaround to the installer script to install a recent node version / nodeenv but it's starting to be like a house of cards getting it working cross-platform on the latest versions for everything.

<!-- gh-comment-id:1066027590 --> @pirate commented on GitHub (Mar 13, 2022): This is somewhat expected, Ubuntu's strict version pinning for apt packages makes it so the default npm install is too old to run the newest single-file version. You have to choose, do you want a newer node install and the latest and greatest single-file (add the apt repo for the latest node.js versions), or the old node + old singlefile (install them manually). I can add a workaround to the installer script to install a recent node version / nodeenv but it's starting to be like a house of cards getting it working cross-platform on the latest versions for everything.
Author
Owner

@mobilelifeful commented on GitHub (Apr 7, 2022):

@pirate Can you please elaborate a bit more on "do you want a newer node install and the latest and greatest single-file (add the apt repo for the latest node.js versions), or the old node + old singlefile (install them manually)."? by giving a working solution to install them? (that you think is the best)

"same" env. set up of ubuntu.

just found this tool, but can't get it working. Thank you in advance.

<!-- gh-comment-id:1091674030 --> @mobilelifeful commented on GitHub (Apr 7, 2022): @pirate Can you please elaborate a bit more on "do you want a newer node install and the latest and greatest single-file (add the apt repo for the latest node.js versions), or the old node + old singlefile (install them manually)."? by giving a working solution to install them? (that you think is the best) "same" env. set up of ubuntu. just found this tool, but can't get it working. Thank you in advance.
Author
Owner

@pirate commented on GitHub (Jan 31, 2023):

Follow these instructions to install the latest version of NodeJS + NPM on Ubuntu/Debian based OS's https://github.com/nodesource/distributions#debinstall npm install -g npm

I also added a note to the README instructions as you suggested: https://github.com/ArchiveBox/ArchiveBox/blob/dev/README.md#-package-manager-setup

image

<!-- gh-comment-id:1409601155 --> @pirate commented on GitHub (Jan 31, 2023): Follow these instructions to install the latest version of NodeJS + NPM on Ubuntu/Debian based OS's https://github.com/nodesource/distributions#debinstall `npm install -g npm` I also added a note to the README instructions as you suggested: https://github.com/ArchiveBox/ArchiveBox/blob/dev/README.md#-package-manager-setup ![image](https://user-images.githubusercontent.com/511499/215634690-21232c25-981f-46fb-bb23-6bcc2617a24d.png)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ArchiveBox#581
No description provided.