Unable to install npm package from git source

I am attempting to install a package from a git repository that I had previously forked.

Here is the command I tried:

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

Unfortunately, I encountered this error message:

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

Even after trying different flags such as --save or removing it altogether, the error persisted. The suggested solution of using --also=dev did not solve the issue either.

UPDATE: npm version is 6.14.13

UPDATE 2:

Strangely, npm now requires sudo permission to execute this command (even though I have never used sudo with npm before and all other packages were installed without it). Running the command with sudo led to a 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.

It seems that even for a public repository, npm now demands a key.

UPDATE 3: NodeJS (with npm) was installed through sudo dnf as a Fedora module, while git was installed using the usual sudo dnf install method, nothing out of the ordinary.

Answer №1

When requesting a public repository, it seems to require a key for some reason.

However, an SSH URL always necessitates a public key for user authentication before accessing the repository (which is permitted since it's public).

If SSH presents an issue:

git config --global url."https://github.com/".insteadOf ssh://example/
git config --global url."https://github.com/".insteadOf another@example.com:

Alternatively:

git config --global url."https://".insteadOf ssh://

This way, the npm command will utilize HTTPS URLs rather than SSH ones.

Answer №2

It appears that the issue was due to compatibility problems. I followed the recommendation and updated npm from version 6.14.13 to 7.20

npm install npm@latest -g

After this update, all the issues disappeared

Answer №3

Check out this helpful resource

npm install # Installs production dependencies only
npm install --only=dev # Install development dependencies only

Answer №4

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

Consider using this command instead, as the --save-dev option will no longer be supported in upcoming versions.

Answer №5

<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8deae4f9cdeae4f9e5f8efa3eee2e0">[email protected]</a>: Access Denied (publickey).

Kindly refer to the GitHub documentation to set up ssh access.
You must include your ssh public key in your profile.
https://docs.github.com/en/authentication/troubleshooting-ssh/error-permission-denied-publickey

Confirm using

ssh -vT <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3d5a54497d5a544955485f135e5250">[email protected]</a>
and then attempt to install your npm package once more.

Answer №6

If you're looking for a solution, give this a shot: take a look at this

npm install @tinkoff/invest-openapi-js-sdk --save

Answer №7

Thank you, The issue has been resolved using the following command. However, there was some extra space after the hyphen. Below is the command I used to fix the problem:

npm install @angular/animations@latest --save

Ensure that you run the command as an administrator.

Answer №8

Impressive! Following a suggestion from @catsaredoomed, it seems that there was indeed a bug present in certain versions of npm. In my situation, the issue stemmed from using npm 8.5.1.

Currently, I am utilizing Ubuntu 22.04 LTS within a docker environment, where the default Node version is v12.22.9 paired with npm v8.5.1. Attempting to update npm to the latest version globally using npm install -g npm@latest proved unsuccessful due to compatibility issues with Node v12. Through research conducted on Aug 3, 2023, I discovered that the most recent npm version supporting Node v12 is 8.19.4. Subsequently, I executed the following command:

npm install -g <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7d130d103d45553a54595b">[email protected]</a>

Upon logging out and back into my shell session, npm successfully updated, allowing for seamless execution of npm install without encountering any further complications.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to utilize TypeScript module augmentation with material-ui components?

I have gone through the answers provided in this source and also here in this link, but it appears that they are outdated. I attempted to enhance the type definition for the button component in various ways, including a separate typings file (.d.ts) as we ...

Emulate a link click using key input

Hey there! I have this link example: <a href"http://google.es">Link</a> I'm wondering if it's possible to use JavaScript or a similar tool so that when I press a specific key, like the number 5 on the keyboard, it acts as if I click ...

Encountered a syscall spawn git error while running npm install command

I recently attempted to execute npm install and encountered the following problems: Even after attempting to clear cache forcibly, installing git, and updating node, none of these solutions proved effective. Above is the specific error message I received ...

"Despite using bcrypt in nodejs, the comparison of the hash with the password consistently results in a

Seeking assistance with the npm package 'bcrypt' to securely store passwords in my PSQL database and authenticate users. The steps I am taking: 1) Sign up: Storing username and encrypted password in PostgreSQL createUser: function(username, p ...

Cutting-edge Angular2 modules

Starting a new Sails + Angular2 project has been quite the adventure for me. I followed the module configurations from a tutorial I found, but then realized they were different from those in Google's latest heroes tutorial. After encountering some npm ...

Converting large JSON data (approximately 100MB) into an Excel file using JavaScript

As a beginner in the realm of REST technology, I find myself navigating through a JSON response received from a server and showcasing the data on the client side. Currently, I am faced with handling approximately 22MB of JSON data that needs to be exporte ...

List of nested HTML tags in Javascript

I have been tasked with creating a specific HTML structure: <div id="dcontent"> <ul class="thm"> <li><a href="#"><img src="img/theme1.jpg" id="t1" border="none"/></a></li> <li><a href= ...

Ways to address the problem of returning assignments

I encountered an issue while working on my code Error message: Arrow function should not return assignment no-return-assign The problematic code snippet is as follows: await DB.Place.find( match, // key to filter (err, doc) => (listOfObje ...

Having trouble with opening and closing popup windows in JavaScript while using Android frames?

To display additional information for the user, I create a new tab using the following code: window.open("/Home/Agreement", "_blank"); Within the Agreement View, there is a button with JavaScript that allows the user to close the Popup and return to the m ...

Issue with the useState hook not correctly updating a value

I'm a beginner in the world of react and I'm puzzled by why the title inside the h1 tag updates, but the url within the Image Component remains unchanged? Component Overview import React, { useState, useEffect, useContext } from 'react' ...

How can we determine if the return value from Object.values is an array or not, since it returns a JavaScript array without the brackets?

In my programming code, I work with two separate JSON files. I iterate through each item in the first file and compare its values with those in the second file. Based on the comparison results, I generate a third JSON file which essentially merges the cont ...

What is the process for choosing a category in the freebase search widget?

For my current project, I have been utilizing the Freebase Search Widget. It allows me to select words from a suggestion list in my input box. However, I am curious about how to also obtain the category in another text box. Here is an example that demonst ...

How to customize the checkbox color in Material UI?

I've been attempting to adjust the color of checkboxes and radio buttons. After conducting some research, I stumbled upon this helpful link: Material UI change Input's active color Unfortunately, I keep encountering the following error: (0 , _ ...

Accessing the AppContext in Next.js within the _document file is the

My challenge with using next js is the occurrence of Content-Security-Policy issues due to the inline styles it utilizes. If 'unsafe-inline' is not added to the style-src, you will encounter the error message 'Refused to apply inline style ...

Why am I seeing back-end console errors that are related to my front-end?

Recently, I encountered an error message that prevents me from using 'import' in my front end code when trying to execute 'node index'. This issue never occurred before, and it only arose when I returned to this project. In my backend ...

Sequelize.Model not being recognized for imported model

I am encountering an issue while trying to implement a sequelize N:M relation through another table. The error message I keep receiving is as follows: throw new Error(${this.name}.belongsToMany called with something that's not a subclass of Sequelize ...

Transitioning away from bower in the latest 2.15.1 ember-cli update

I have been making changes to my Ember project, specifically moving away from using bower dependencies. After updating ember-cli to version 2.15.1, I transitioned the bower dependencies to package.json. Here is a list of dependencies that were moved: "fon ...

Execute the gulp module on the source files

Recently, I've been delving into the world of gulp and trying to enhance the readability of my js source files. I have a task in place (which executes successfully) that utilizes 'gulp-beautify' to beautify the js files: gulp.task('js& ...

Adjusting the width of a nested iframe within two div containers

I am trying to dynamically change the width of a structure using JavaScript. Here is the current setup: <div id="HTMLGroupBox742928" class="HTMLGroupBox" style="width:1366px"> <div style="width:800px;"> <iframe id="notReliable_C ...

What is the process for implementing npm packages in Laravel after they have been successfully installed?

After installing npm packages in Laravel, how do I require them? For example, let's say I need the package sweetalert2. To install it, run the command: npm install --save sweetalert2 Now, do I need to include it in the \resources\assets ...