'Cannot install with npm package from git

I am trying to install package from git, which I forked earlier.

I try

npm i catsaredoomed/invest-openapi-js-sdk --save-dev

I've got

npm ERR! prepareGitDep 2> npm WARN install Usage of the `--dev` option is deprecated. Use `--also=dev` instead.

Moreover, this error even don't depend on flag I provided. I can set --save or don't provide at all, it persists anyway. Surely, --also=dev doesn't change this situation

UPD: npm -v 6.14.13

UPD 2:

It appears npm for whatever reason needs sudo to run this command (I didn't use sudo with npm any times before and all other packages for app were installed without sudo). So with sudo this command runs, but only to make new error

    npm ERR! command git --no-replace-objects ls-remote ssh://[email protected]/catsaredoomed/invest-openapi-js-sdk.git
npm ERR! [email protected]: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.

For whatever reason when asking for public (!) repo it needs key

UPD 3: NodeJS (with npm) is installed through sudo dnf as Fedora module, git as usual sudo dnf install, nothing special



Solution 1:[1]

Seems it was compatibility issue. I updated npm like recommended from 6.14.13 to 7.20

npm install npm@latest -g

And all issues were gone

Solution 2:[2]

npm i catsaredoomed/invest-openapi-js-sdk --only=dev 

Try this, the --save-dev option is deprecated due to changes in the future versions.

Solution 3:[3]

[email protected]: Permission denied (publickey).
Please follow documentation from Github in order to add ssh access.
You have to add ssh public key on your profile.
https://docs.github.com/en/authentication/troubleshooting-ssh/error-permission-denied-publickey

Verify with ssh -vT [email protected] and after try again to install your npm package.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 catsaredoomed
Solution 2
Solution 3 awat