Error installing Angular using npm due to require-from-string

后端 未结 6 778
名媛妹妹
名媛妹妹 2020-11-29 09:00

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
         


        
相关标签:
6条回答
  • 2020-11-29 09:40

    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.

    0 讨论(0)
  • 2020-11-29 09:54

    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.

    0 讨论(0)
  • 2020-11-29 09:55

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

    the problem persist here

    0 讨论(0)
  • 2020-11-29 09:58

    npm is having issues. This should just work.

    0 讨论(0)
  • 2020-11-29 10:00

    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.

    0 讨论(0)
  • 2020-11-29 10:06

    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

    0 讨论(0)
提交回复
热议问题