21

How to resolve this error as I am not able to install Angular.

Please see the below exception:

C:\Users\absin\node>npm install -g @angular/cli
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!     C:\Users\absin\AppData\Roaming\npm-cache\_logs\2018-01-06T19_07_00_000Z-debug.log

even after temporal solution:

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

still getting this error

12
  • node version v8.9.4 and npm 5.6.0 Commented Jan 6, 2018 at 19:14
  • 3
    github.com/angular/angular-cli/issues/9113 Commented Jan 6, 2018 at 19:17
  • 1
    Have a look at the issue link I added. They give the impression this will clear up soon. Magic! :) Commented Jan 6, 2018 at 19:19
  • 1
    I am getting the same thing trying to create a brand new react app. It appears that the npm package is gone. Also, had a very similar thing happen with read-all-stream-3.1.0. It seems like something is up ... Commented Jan 6, 2018 at 19:20
  • 1
    I'm having the same issue when deploying an Angular app to Heroku Commented Jan 6, 2018 at 19:21

6 Answers 6

8

as stated in the issue link:

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

UPDATE:

It appears they are working on it. The require-from-string page used to return a 404, but at least now it loads the correct page on NPM's website: https://www.npmjs.com/package/require-from-string

Still doesn't appear to be working through npm install yet.

UPDATE 2:

An official response from NPM: https://status.npmjs.org/incidents/41zfb8qpvrdj

UPDATE 3: issue seems to be resolved.

Sign up to request clarification or add additional context in comments.

2 Comments

temporary solution is working but again same issue while creating a new project using ng new command
temporal solution is not working when trying to install a fresh cli with -g (npm install -g @angular/cli) also I tried npm install -g https://github.com/floatdrop/require-from-string/tarball/v1.1.0 seemed like a success. Any idea how to get that to work in the meantime?
3

Even if https://status.npmjs.org/ says that it s all ok now,

the problem persist here

Comments

2

enter image description here

some problem with NPM registry some of the packages got deleted. They are restoring it... it will be available shortly

Temp solution use the missing package from already running projects that or older projects.

Comments

2

I had the same issue. So when I used yarn it worked well and not having any problem to create new projects also.

yarn global add @angular/cli

again, when you create new app ng new newapp it will fail because at this moment npm is not able to find a package called require-from-string. But the you can run yarn to install all the packages. Yarn will ask which version of the require-from-string is needed. you can choose it.

2 Comments

wrong, you can only do so as you installed required packages on this machine before as "Yarn caches every package it downloads so it never needs to download it again". If you will try yarn on a fresh installation it will also fail. First with not having access to version 1.1.0 of require-from-string and eventually with An unexpected error occurred: "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz: Request failed \"404 Not Found\"".. It looks like yarn is just a (cheap) npm proxy as this reflects the current state there.
and you can ng set --global packageManager=yarn in order to always use yarn.
2

npm is having issues. This should just work.

Comments

1

npm registry issue is now fixed according to https://status.npmjs.org/incidents/41zfb8qpvrdj

Solution

rm ./package-lock.json
git commit -am "Removed broken package-lock.json file."
git push heroku master

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.