无法安装最新的npm

时间:2018-09-27 09:51:43

标签: node.js npm npm-install

我一直在尝试使用以下命令安装最新的npm,

npm install --save-dev

由于某种原因它失败并出现以下错误。

> npm WARN optional SKIPPING OPTIONAL DEPENDENCY:
> web-automation@git+ssh://git@stash.sprinteins.com:7999/qs/web-test-automation.git
> (node_modules\web-automation): npm WARN optional SKIPPING OPTIONAL
> DEPENDENCY: Error while executing: npm WARN optional SKIPPING OPTIONAL
> DEPENDENCY: C:\Users\momural\AppData\Local\Programs\Git\cmd\git.EXE
> ls-remote -h -t
> ssh://git@stash.sprinteins.com:7999/qs/web-test-automation.gi t npm
> WARN optional SKIPPING OPTIONAL DEPENDENCY: npm WARN optional SKIPPING
> OPTIONAL DEPENDENCY: ssh: connect to host stash.sprinteins.com port
> 7999: Connection timed out npm WARN optional SKIPPING OPTIONAL
> DEPENDENCY: fatal: Could not read from remote repository. npm WARN
> optional SKIPPING OPTIONAL DEPENDENCY: npm WARN optional SKIPPING
> OPTIONAL DEPENDENCY: Please make sure you have the correct access
> rights npm WARN optional SKIPPING OPTIONAL DEPENDENCY: and the
> repository exists. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: npm
> WARN optional SKIPPING OPTIONAL DEPENDENCY: exited with error code:
> 128
> 
> npm ERR! code ETIMEDOUT npm ERR! errno ETIMEDOUT npm ERR! network
> request to https://registry.npmjs.org/connect-mongo failed, reason:
> connect ETIMEDOUT 104.16.16.35:443 npm ERR! network This is a problem
> related to network connectivity. npm ERR! network In most cases you
> are behind a proxy or have bad network settings. npm ERR! network npm
> ERR! network If you are behind a proxy, please make sure that the npm
> ERR! network 'proxy' config is set properly.  See: 'npm help config'
> 
> npm ERR! A complete log of this run can be found in: npm ERR!    
> C:\Users\momural\AppData\Roaming\npm-cache\_logs\2018-09-27T06_54_20_779Z-
  

节点版本为8.11.2,npm版本为5.6.0

我可以知道会有什么问题吗?

2 个答案:

答案 0 :(得分:1)

尝试一下:

public function getSolrResults ()
{
        /** @var $searchInstance \ApacheSolrForTypo3\Solr\Search */
        $searchInstance = GeneralUtility::makeInstance(Search::class);

        $this->solrQuery->useRawQueryString(true);
        $this->solrQuery->useQueryString('*');
        $searchResponse = $searchInstance->search($this->solrQuery->getQuery());
        $parsedData = $searchResponse->getRawResponse();

        $responseAsArray = json_decode($parsedData, true);
        return $responseAsArray;
}

然后运行:

npm cache verify

答案 1 :(得分:0)

  

错误!网络如果您是代理人,请确保npm

这似乎是网络问题。您将无法下载更新。您正在浏览代理吗?