The only thing I can think of to cause this problem is I tried this: 'npm config set prefix ~/npm' - nothing worked correctly afterwards, but it could be a coincidence, since the problem persisted after completely removing node and npm and installing nvm.
Manage the npm configuration files Synopsis npm config set [-g|--global] npm config get npm config delete npm config list [-l] [--json] npm config edit npm get npm set [-g|--global] aliases: c Description. Nvidia geforce gtx 745 driver. Npm gets its config settings from the command line, environment variables, npmrc files, and in some cases, the package.json file. Properly install and configure Nodejs and npm on Ubuntu NOTE: this article is valid as of JAN 2016 NOTE (bis): remove any node and/or npm from your machine before executing the following operations. In NodeJs the npm uses a configuration file which can be easily edited using the npm config edit command. You can use that to set the proxy values directly into the file. You can use that to set the proxy values directly into the file. It looks like the files npm uses to edit its config files are not created on a clean install, as npm has a default option for each one. This is why you can still get options with npm config get: having those files only overrides the defaults, it doesn't create the options from scratch.
Active1 year, 11 months ago
I want to be able to clone a git repository using a URL as specified here
I am getting an error saying
npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/XYZ
So I should also be able to specify the registry while doing since modules are supposed to be picked up from a internal repository.
Is it possible to specify registry while doing npm install with git remote url?
Mike Morearty7,59244 gold badges2727 silver badges3333 bronze badges
54.8k55 gold badges4040 silver badges6363 bronze badges
2 Answers
npm
gets its config settings from the command line, environment variables, and npmrc files. You can try to specify registry in a npmrc file, and module in the command line. To change registry, you can use command: Wincleaner application setup.You can also change configs with the help of
Mike Morearty--
argument. Putting --foo bar
on the command line sets the foo configuration parameter to 'bar'. So you can try something like that:Npm Install Config.json
7,59244 gold badges2727 silver badges3333 bronze badges
Alexandr LazarevAlexandr Lazarev9,39522 gold badges2323 silver badges3737 bronze badges
Not the best way but If you are using mac or linux even in windows you can set alias for different registries.
owaishanif786owaishanif7862,38222 gold badges2222 silver badges3333 bronze badges
Not the answer you're looking for? Browse other questions tagged node.jsgit-clonenpm-install or ask your own question.
Node.js (and npm) is available in the official Debian, Ubuntu and Linux Mint repositories, but depending on the OS version you're using, they might have some old versions that need to be updated.This article will explain how to install Node.js and npm from the NodeSource repository as well as how to set up npm so you can use it to properly install Node.js packages globally in your user folder, so it doesn't mess with any permissions.
Install Node.js and npm from the Node.js repository in Debian, Ubuntu and Linux Mint
An alternative way of installing Node.js and managing multiple active versions is using NVM, so you may want to check it out. This guide will use the official Node.js-provided repository instead.
These instructions are for:
- Debian 8 (jessie), Debian 9 (stretch), Debian 10 (buster), Debian testing and Debian unstable
- Ubuntu 19.04, 18.04 LTS, 16.04 LTS and 14.04 LTS
- Linux Mint 17, 17.x, 18, 18.x, 19 and 19.x
- Raspberry Pi using Debian (Raspbian) or Ubuntu, with armhf (ARM 32-bit hard-float, ARMv7) or arm64 (ARM 64-bit, ARMv8)
- Other Linux distributions based on either the Debian or Ubuntu versions above
1. Install curl (used to download the official Node.js installation script which adds the repository and key) and build-essential (which will be used to compile and install native addons):
2. Run the Node.js installation script (provided by nodejs.org).
Nodejs 8 is available for all Ubuntu, Linux Mint and Debian supported versions, including Ubuntu 14.04 / Linux Mint 17. Nodejs 11 and 12 are only available for Ubuntu 16.04 and newer, Debian 8 and newer, and Linux Mint 18 and newer.
- To install Node.js 8:
- To install Node.js 11:
- To install Node.js 12:
The nodejs package from the official NodeSource repository includes npm.
Configure npm to install packages globally without root
Using npm installed from either the Ubuntu repositories or the Node.js repository requires running under root by default to install packages. This should be avoided, as per many articles around the web.
To get npm to install packages globally in your home folder (and add the folder to your PATH), you can use a simple script available here. This script does not work if you use NVM!
You can download the script and run it using these commands:
After following the instructions, source your .bashrc file:
Now you will be able to install npm packages globally without root / sudo, like this:
Node.js logo image is from Wikipedia.