由于require-from-string,使用npm安装Angular时出错

时间:2022-05-20 13:45:23

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

如何解决此错误,因为我无法安装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 由于require-from-string,使用npm安装Angular时出错

仍然得到这个

6 个解决方案

#1


2  

由于require-from-string,使用npm安装Angular时出错

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

NPM注册表的一些问题,一些软件包被删除了。他们正在恢复它...它很快就会出现

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

临时解决方案使用已经运行的项目或旧项目中缺少的包。

#2


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

时态解决方案: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

看来他们正在研究它。用于返回404的require-from-string页面,但至少现在它在NPM的网站上加载了正确的页面:https://www.npmjs.com/package/require-from-string

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

仍然似乎没有通过npm安装工作。

UPDATE 2:

更新2:

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

NPM的官方回应:https://status.npmjs.org/incidents/41zfb8qpvrdj

UPDATE 3: issue seems to be resolved.

更新3:问题似乎得到解决。

#3


3  

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

即使https://status.npmjs.org/说现在一切都好,

the problem persist here

问题在这里持续存在

#4


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.

再次,当您创建新的应用程序新的newapp时,它将失败,因为此时npm无法找到名为require-from-string的包。但你可以运行纱线来安装所有的包。纱线将询问需要哪个版本的require-from-string。你可以选择它。

#5


2  

npm is having issues. This should just work.

npm有问题。这应该工作。

#6


1  

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

npm注册问题现已根据https://status.npmjs.org/incidents/41zfb8qpvrdj修复

Solution

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

rm ./package-lock.json git commit -am“删除了破损的package-lock.json文件。” git push heroku master

#1


2  

由于require-from-string,使用npm安装Angular时出错

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

NPM注册表的一些问题,一些软件包被删除了。他们正在恢复它...它很快就会出现

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

临时解决方案使用已经运行的项目或旧项目中缺少的包。

#2


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

时态解决方案: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

看来他们正在研究它。用于返回404的require-from-string页面,但至少现在它在NPM的网站上加载了正确的页面:https://www.npmjs.com/package/require-from-string

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

仍然似乎没有通过npm安装工作。

UPDATE 2:

更新2:

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

NPM的官方回应:https://status.npmjs.org/incidents/41zfb8qpvrdj

UPDATE 3: issue seems to be resolved.

更新3:问题似乎得到解决。

#3


3  

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

即使https://status.npmjs.org/说现在一切都好,

the problem persist here

问题在这里持续存在

#4


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.

再次,当您创建新的应用程序新的newapp时,它将失败,因为此时npm无法找到名为require-from-string的包。但你可以运行纱线来安装所有的包。纱线将询问需要哪个版本的require-from-string。你可以选择它。

#5


2  

npm is having issues. This should just work.

npm有问题。这应该工作。

#6


1  

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

npm注册问题现已根据https://status.npmjs.org/incidents/41zfb8qpvrdj修复

Solution

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

rm ./package-lock.json git commit -am“删除了破损的package-lock.json文件。” git push heroku master