postlight / parser

📜 Extract meaningful content from the chaos of a web page
https://reader.postlight.com
Apache License 2.0
5.34k stars 434 forks source link

Installing the CLI fails with npm 8 #678

Open pccowboy opened 1 year ago

pccowboy commented 1 year ago

Platform: Linux bunkhouse-7 3.10.0-1160.11.1.el7.x86_64 #1 SMP Fri Dec 18 16:34:56 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Mercury-Parser Version: N/A Node Version: v14.15.4 npm -v: 8.16.0

Expected Behavior

$ sudo npm -g install @postlight/mercury-parser added 1 packages, and audited ## packages in ##s

Current Behavior

$ sudo npm -g install @postlight/mercury-parser npm ERR! code 128 npm ERR! An unknown git error occurred npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/postlight/difflib.js.git npm ERR! Permission denied (publickey). npm ERR! fatal: Could not read from remote repository. npm ERR! npm ERR! Please make sure you have the correct access rights npm ERR! and the repository exists.

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2022-08-04T00_59_56_748Z-debug-0.log

Steps to Reproduce

  1. npm install npm@latest
  2. sudo npm -g install @postlight/mercury-parser

Detailed Description

From what I am able to tell, this is due to https://github.com/npm/cli/issues/2610. The ssh protocol cannot be used to pull the postlight/difflib repo with npm > 6.

Possible Solution

Change lines 117-119 of https://github.com/postlight/mercury-parser/blob/master/package.json to read:

    "browser-request": "git+https://git@github.com/postlight/browser-request#feat-add-headers-to-response",
    "cheerio": "^0.22.0",
    "difflib": "git+https://git@github.com/postlight/difflib.js",
chrisgrieser commented 1 year ago

I have the same issue:

npm -g install @postlight/parser
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@postlight%2fparser - Not found
npm ERR! 404
npm ERR! 404  '@postlight/parser@*' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

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

However, npm -g install @postlight/mercury-parser does work, though it does have a bunch of vulnerability warnings and also seems to be an outdated version from a year ago?