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 send an array to a modal?

Utilizing Axios for retrieving a list of countries from a REST API, I have implemented modals with each displaying the name and flag of a country. Upon clicking on any country name, the console will log the selected country. I am looking to pass the last ...

Automatic page switch upon dropdown selection

I'm not very proficient in JavaScript and I want to modify a form so that it automatically updates when a dropdown option is selected, without needing to click a separate "Go" button. How can I adjust the code below? It contains three different dropd ...

Unable to launch ReactJS using npm start anymore

When I create a new ReactJS app using npx create-react-app testapp, the issue arises where the command npm start (or any other npm-script) does not work in ANY of my react projects. There is no output to the console, and upon checking the log files in ~/.n ...

Issue encountered during the creation of a new Angular application (npm ERROR! 404 Not Found: @angular/animations@~7.1.0.)

I am currently using Windows 10, Node v11.0.0, and Angular CLI: 7.1.4. I encountered an error when trying to create a new Angular application. The error message is npm ERR! code E404 npm ERR! 404 Not Found: @angular/animations@~7.1.0. Error stack: 0 info ...

The issue in Vue JS arises when trying to access JSON key values from an object array using v-for

I am currently working on parsing a list of objects found within a JSON payload into a table utilizing Vue.js. My goal is to extract the keys from the initial object in the array and use them as headings for the table. While the code I have in place succe ...

Are toggle functionalities triggered when an element is clicked?

How come the span triggers functions a and b when first clicked, is there a way to set it up so that it calls function a on the first click and then function b on the second click? function a(id) { $.post("url.php", {'id':id}, function() { ...

Creating Immersive Web Pages

I am currently generating a large amount of data in HTML for periodic reporting purposes. The table consists of approximately 10,000 rows, totaling around 7MB in size. As a result, when users try to open it, the browser sometimes becomes unresponsive due t ...

I am working on two Angular projects and I am looking to integrate one of them into the other project

In my development work, I am juggling two Angular projects on Github: AngularApp1 and AngularApp2. AngularApp1 is a robust project with many components, while AngularApp2 serves a more specific purpose. My goal is to have a button in AngularApp1 that open ...

Is it possible to merge a variable within single quotes in XPath?

Currently working with nodeJS and experimenting with the following code snippet: for (let i = 1; i <= elSize; i++) { try { let DeviceName = await driver .findElement(By.xpath("//span[@class='a-size-medium a-color-base a-text-normal ...

Discovering common time intervals without the date component in between

I need to identify the intersection between two time ranges, focusing solely on the time and not the date. For instance, range_1 is from 9AM to 6PM while range_2 spans from 5PM to 8AM. The times are in the 24-hour format. I have a solution that finds the o ...

Vanishing HTML upon initial entry to the site using Gatsby and Material UI exclusively in live deployment

I run a blog using Gatsby that includes Material UI components to fetch markdown files through GraphQL. During development, everything operates smoothly. However, in production (after running gatsby build && gatsby serve), the HTML doesn't di ...

Looking to bring in a non-ES6 library into VueJS without using export statements

Currently, I am faced with an interesting challenge. For a forthcoming VueJS project, we must utilize a library that is quite outdated but there is simply not enough time to redevelop it. The library is essentially a JavaScript file which consists of num ...

Obtaining the pathname in a NextJS file like _document.js is a matter of accessing

I'm looking to retrieve the current URL path in my /page/_document.js file. I've created a class and my goal is to implement a conditional statement based on this value. Below is the code snippet (similar to the example provided in NextJS docume ...

Using AngularJS, learn how to populate array objects within a JSON object

I'm trying to load array objects from a multi-select control, then populate a model object called "name" with its name and age values. After that, I want to load an array from a select element into the model object. However, the ng-model directive on ...

Does the TS keyof typeof <Object> rule prohibit the assignment of object.keys(<Object>)?

I'm having trouble understanding the issue with this code snippet. Here is the piece of code in question: export type SportsTypes = keyof typeof SportsIcons export const sports: SportsTypes[] = Object.keys(SportsIcons); The problem arises when I at ...

AJAX request post parameters not recognized in ColdFusion form scope

I am currently developing a ColdFusion 8 training application that involves creating AJAX requests without using any libraries like jQuery. This is to support a basic CRUD application where data is retrieved and processed through various layers of the syst ...

Using node.js for synchronous callbacks in node.js programming

I am new to node.js, and from what I've gathered, each callback creates a new event that can be executed in parallel. For instance, consider the following code with a callback: function testFunction(var1){ s3.head(var1, function(data, err){ ...

What is the best way to conceal a set of buttons on the main page using vue.js?

I'm having trouble hiding a button-group on the main page. It should disappear when either the button moveTo(0) is clicked or when scrolling to the top of the page. show: function() { this.scrollTop = (window.pageYOffset !== undefined) ? windo ...

Overlap of columns within a nested flexbox arrangement

While working with React and Styled Components, I encountered a problem of elements overlapping each other: https://i.stack.imgur.com/RuCYu.png There are a few instances of overlap, including: The padding below the <ul> element is colliding with ...

Empty Canvas: Google Charts Graph Fails to Populate

I am currently using mysql, php, and javascript to display a curve chart. The issue I am facing is that the chart appears blank. google.load('visualization', '1.0', {'packages':['corechart']}); google.setOnLo ...