Angular-cli: Cannot install @angular/cli because of dependency issue

Created on 6 Jan 2018  路  76Comments  路  Source: angular/angular-cli

When I try to install @angular/cli, I get the following error:

npm install -g @angular/cli@latest
npm ERR! code ETARGET
npm ERR! notarget No matching version found for require-from-string@^1.1.0
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of 'cosmiconfig'
npm ERR! notarget

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/dirk/.npm/_logs/2018-01-06T18_58_49_094Z-debug.log

Versions

N/A

Repro steps

Run

npm install @angular/cli@latest

Observed behavior

Angular CLI does not install

Desired behavior

Angular CLI installs

Mention any other details that might be useful (optional)

The package require-from-string seemed to be gone from NPM for a while, but also seems to be back now

Most helpful comment

I just started to learn Angular 5 and reached to this issue post.
Just imagine my feelings about my learning trip ^_^

All 76 comments

@DirkWillem Yes, It was working fine few hours ago, but broke in last few hours. I'm unable to create new project due to this:

npm ERR! code ETARGET
npm ERR! notarget No matching version found for require-from-string@^1.1.0
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of 'cosmiconfig'
npm ERR! notarget
npm ERR! A complete log of this run can be found in:
npm ERR! /home/saad/.npm/_logs/2018-01-06T19_02_10_419Z-debug.log

Note: Creating new project via ng new is also no longer working.

temporal solution:
npm install https://github.com/floatdrop/require-from-string/tarball/v1.1.0 --save
npm install

I'm getting this issue too!

@EstebanFuentealba temp solution works like a charm

same issue i am facing here is post stackoverflow link
temp solution is working but i am not able to create a new project using ng new command

Temp solution doesnt work when i want to install fresh -g cli:
sudo npm install -g @angular/cli@latest

facing the same issue.. :(
even npm install doesn't work.

Some russian guy (floatdrop) deleted his account on npm. There are various packages that angular/cli, Vue.js and a whole lot of other projects that depended on his stuff.

Yep, Vue CLI and Create-Nuxt-App seem to have identical problem...

Sigh...

Same issue as well. Looks like it's not on angular-cli only. It's on the registry itself. :(

@patrickoliveras if you delete your npm account, it shouldn't delete the npm packages

This is the dude, if anyone is interested in republishing the needed versions of the various packages to npm: https://github.com/floatdrop

I just started to learn Angular 5 and reached to this issue post.
Just imagine my feelings about my learning trip ^_^

@WahidBitar it is not an angular related issue. It's something with npm. Check this issue https://github.com/npm/registry/issues/255

@WahidBitar I just started my final year research project. -_- how lucky i am.

It seems like npm is not able to find the package require-from-string. So I tried yarn and it worked. Yarn allows you to choose a version for require-from-string

@ocombe Hm. You learn a bit everyday! So maybe he just wants the world to get a bit toasty.

@bnymncoskuner Yes I know but it was a pain in the a** till I knew it :D

to delete an account from npm you have to email the npm support :-/
if they really removed his account, then they fu** up hard!

is like Alfred said in the Batman movie: some people just want to see the world burn

https://www.npmjs.com/~floatdrop
Looks like it's up, but the packages aren't there.

Same here @WahidBitar ahah
I'm trying to dockerize my MEAN Stack but it fails to build due to that issue...

If you have angular-cli installed already, you can generate a new project and try the temp solution @EstebanFuentealba suggested. It is working for now.

Left pad all over again.

NPM is broken =(((((

when will npm be fixed?

@EstebanFuentealba temporary solutions seems to work but breaks again after installing other new npm packages. 鉂わ笍 馃棥

It is fixed already. Go and try again. I was able to install

@arianlopezc I am facing the same error even now

me tooo same error @arianlopezc @svinesh3691

not working...

Npm is aware of this issue and working on it, it should be fixed soon

Something is really wrong with NPM guys. I installed and this was the message:

  • @angular/[email protected]
    added 177 packages, removed 55 packages, updated 98 packages and moved 8 packages in 50.173s

Is there some ideas like, degrading to some older version of NPM ?

@WahidBitar here we go馃槀馃槀 it's our first step upgrading our project to angular 5 馃拑

It isn't a problem with npm, it's one repository that's broken.

Although, the npm team is also working on this issue

use yarn

I was able to install deps for a project and it seems to be working. I didn't try to re-install angular-cli tho

The only day I had time to check out new features of ng 5. Leftpad 2.0..

What a lovely start for my Angular training journey :D At least I was able to find this issue thread instantly.

Alright NPM has issued a warning to not attempt to republish the missing packages, so hold your horses! https://github.com/npm/registry/issues/255#issuecomment-355771177

Temporal solutions are welcome though

袩懈锌械褑 褏谢芯锌褑褘, 懈 褕芯 褉邪斜懈褌褜??

@patrickoliveras, Hi! @EstebanFuentealba published a workaround.

npm install https://github.com/floatdrop/require-from-string/tarball/v1.1.0 --save
npm install

Regards!

@patrickoliveras have you seen any word on a timeline for the fix for this?

It's literally 29 lines of code:

'use strict';

var Module = require('module');
var path = require('path');

module.exports = function requireFromString(code, filename, opts) {
    if (typeof filename === 'object') {
        opts = filename;
        filename = undefined;
    }

    opts = opts || {};
    filename = filename || '';

    opts.appendPaths = opts.appendPaths || [];
    opts.prependPaths = opts.prependPaths || [];

    if (typeof code !== 'string') {
        throw new Error('code must be a string, not ' + typeof code);
    }

    var paths = Module._nodeModulePaths(path.dirname(filename));

    var m = new Module(filename, module.parent);
    m.filename = filename;
    m.paths = [].concat(opts.prependPaths).concat(paths).concat(opts.appendPaths);
    m._compile(code, filename);

    return m.exports;
};

but install dont still dont works

@keenanamigos you can follow the incident here: https://status.npmjs.org/incidents/41zfb8qpvrdj

@patrickoliveras thank you!

temp solution is not working either

its just wait now

yeap. now have problems with pinkie-promise@^2.0.0 package

not working
npm ERR! code ETARGET
npm ERR! notarget No matching version found for require-from-string@^1.1.0
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of 'cosmiconfig'
npm ERR! notarget
from past 4 hrs at least

RE: pinkie-promise@^2.0.0 package
Yup... same here... so the whole Angular 5 CLI installation process seems pretty well broken [ not to say f**d up...] for now... so I guess we have no choice but clean up the whole mess and all unwanted leftover garbage... then go out and have a beer... then hmmm naah maybe not... a bit too chilly up here... Brrrrrr...

Still not working trying to install angular CLI.
npm ERR! notarget No matching version found for require-from-string@^1.1.0
Hopefully they can fix this issue.

Getting the same error here..still waiting for the fix

You can use npm view require-from-string versions --json and check if version 1.1.0 is there, instead of trying to reinstall every 5 minutes. When you do eventually see 1.1.0, then we should be back on track for installing angular-cli.

you can follow this thread
https://github.com/npm/registry/issues/255

Progress is being made... live update:

jenga2

$ npm view require-from-string versions --json

[
"2.0.2"
]

It麓s Intel! i know it

Workaround: You can copy node_module from the different project.

You can check npm status updates here
https://status.npmjs.org/

It finally worked! :-)

still having issues with require-from-string@^1.1.0

Still the error.

try: npm install npm@next -g , then install @angular/cli

it works right now :)

Here it came back working! :)

RE: Here it came back working :)
Same thing up here: It's aliiiive... It's aliiiive... Everything is back and running... Yeeeeeeeess :)

npm just gave everyone free Saturday evening :)

So i think this can be closed right?

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings