parser icon indicating copy to clipboard operation
parser copied to clipboard

Installing the CLI fails with npm 8

Open pccowboy opened this issue 3 years ago • 1 comments
trafficstars

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://[email protected]/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://[email protected]/postlight/browser-request#feat-add-headers-to-response",
    "cheerio": "^0.22.0",
    "difflib": "git+https://[email protected]/postlight/difflib.js",

pccowboy avatar Aug 04 '22 06:08 pccowboy

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?

chrisgrieser avatar Sep 13 '22 19:09 chrisgrieser