Npm install fails because the package is not in the registry

I have a problem with a project in which we use node and brunch. The problem is relevant for the brunch, but it can happen for any module, I think.

The easiest way to play it now is to do the following in a new folder:

npm init npm install --save-dev brunch 

The problem is that the brunch depends on the log, which in turn depends on ansi-color, which no longer has an entry in npmregistry:

https://registry.npmjs.org/ansi-color

I think it could be a github project: https://github.com/loopj/commonjs-ansi-color

In any case, I cannot continue, and all of our assemblies do not work, because they cannot get the given dependency.

I could somehow use npm trimming, but it depends on the modules already existing in node_modules that I don't see right now.

So, how can I get npm to use ansi-color from another location or ignore the dependency?

+6
source share
2 answers

Not sure about npm 2, but you can fix it with beta npm 3. npm 3 has a flat node_modules directory. Thus, the modules can be located at the upper level. Read Changelog .

Missing modules can be installed directly from their Github repository, depending on the level in your project. If npm finds a module with the same version in the node_modules directory, it will no longer search for it in the registry.

Install npm 3:

 npm install -g npm@3-latest 

Then set the parameters:

 //install missing module from other location npm install https://github.com/loopj/commonjs-ansi-color.git --save-dev npm install --save-dev brunch 
+2
source

It seems that ansi-color is again included in the npm registry (" https://registry.npmjs.org/ansi-color " is online again)

-1
source

All Articles