安装http服务器时出错:找不到ecstatic@^3.0.0

时间:2019-05-02 19:33:36

标签: node.js npm

我是前端开发的新手,现在我必须维护AngularJS应用程序。我正在尝试安装http-server来测试我的应用程序,但是当我运行npm install http-server -g命令时,出现以下错误:

npm ERR! code ETARGET
npm ERR! notarget No matching version found for ecstatic@^3.0.0
npm ERR! notarget In most cases you ir 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 'http-server'
npm ERR! notarget

我没有找到任何解决方案。你们以前看过这个错误吗?

3 个答案:

答案 0 :(得分:12)

他们在4之前的版本中存在安全问题,并删除了它们的下载链接。您可以在这里找到更多详细信息:https://github.com/jfhbrook/node-ecstatic/issues/255

您要么需要以前的缓存版本,要么移动到新版本。

答案 1 :(得分:7)

他们正在努力解决。 这是NPM的一个分支:

npm i http-server-legacy 

yarn install http-server-legacy

来源:https://github.com/indexzero/http-server/issues/521#issuecomment-488843797

答案 2 :(得分:3)

维护者现在已经修补了该库,并且以下版本现在应该可用:

  

2.2.2、3.3.2、4.1.2

Reference