Phonegap安装错误(npm) [英] Phonegap installation error (npm)

查看:243
本文介绍了Phonegap安装错误(npm)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找一个解决方案两天,现在在我的Windows 8.1
系统上设置Phonegap没有任何成功。



每当我尝试安装Phonegap到npm我得到一个错误,我认为必须做
与Cordova(-lib)。



要安装Phonegap我不得不安装Node.js v0.10.28)。之后,我打开Windows Powershell并发出以下命令,像在Phonegap网站上指示:

  npm install -g phonegap 

输出(这是错误的唯一部分)

 错误notarget找不到兼容版本:cordova-lib@'lorinbeer/cordova-lib.git#configparser_module'
错误notarget有效安装目标:
错误notarget [0.21.2,0.21.3]
错误notarget
错误notarget这很可能不是npm本身的问题。
error notarget在大多数情况下,您或您的一个依赖关系请求
错误,而不是指定不存在的包版本。

我也试过通过npm安装Cordova,然后安装Phonegap,但是
didn



使用管理员权限运行Powershell也没有帮助和尝试解决方案的其他人谁也有问题设置Phonegap,但没有什么工作。



我真的希望有人能在这里帮助我。



提前感谢。

解决方案

。如果你检查npm-debug.log,你会注意到,当npm试图访问cordova-lib git仓库URL时,有一个权限问题(权限被拒绝)。实际上,cordova-lib是phonegap的依赖。所以,它不能安装它,我想这就是为什么你得到这个错误。



所以,我试过这个:安装cordova-lib首先,然后Phonegap。然而,它仍然不会工作; npm似乎没有检查是否安装cordova-lib在尝试做之前。
在这一点上,我可以做的是更改从中检索cordova-lib的存储库。这里是NPM安装语法:

  npm install< tarball file> 
npm install< tarball url>
npm install< folder>
npm install< pkg>
npm install< pkg> @< tag>
npm install< pkg> @< version>
npm install< pkg> @< version range>

这意味着我可以从tar.gz文件安装。大!因此,我刚刚访问此页面 https://www.npmjs.org/package/phonegap 以检查phonegap存储库并执行这些步骤:


  1. 下载phonegap-cli repo的zip档(https://github.com/phonegap/phonegap-cli/archive/master.zip

  2. 解压缩

  3. 打开package.json文件并在依赖项中找到cordova-lib条目(第32行)

  4. 将值更改为0.21.3,

  5. 打开CLI并运行以下命令:

  6. p>

      npm install -g path / to / archive / phonegap-cli-master.tar.gz 


现在应该可以了。



希望有帮助!


I have been searching for a solution for two days now to setup Phonegap on my Windows 8.1 system without any success.

Whenever I try to install Phonegap through npm I get an error that I think has to do with Cordova(-lib).

To install Phonegap I had to install Node.js (v0.10.28) on my system. After this I opened up Windows Powershell and issued the following command like instructed on the Phonegap website:

npm install -g phonegap

Output: (This is the only part of the error)

error notarget No compatible version found: cordova-lib@'lorinbeer/cordova-lib.git#configparser_module'
error notarget Valid install targets:
error notarget ["0.21.2","0.21.3"]
error notarget
error notarget This is most likely not a problem with npm itself.
error notarget In most cases you or one of your dependencies are requesting
error notarget a package version that doesn't exist.

I also tried installing just Cordova through the npm and then install Phonegap, but that didn't solve anything either.

Running the Powershell with administrator rights also didn't help and tried solutions of other people who also had problems setting up Phonegap, but nothing works.

I really hope that someone could help me out here.

Thanks in advance.

解决方案

I had the same issue yesterday. If you check npm-debug.log, you'll notice that there is a permission issue ("Permission denied") when npm tries to access the cordova-lib git repository url. Actually, cordova-lib is a dependency for phonegap. So, it can't install it and I think that's why you get that error.

So, I tried this: install cordova-lib first then Phonegap. Yet, it still won't work; npm does not seem to check if cordova-lib is installed before trying to do it. At this point, what I could do is to change the repository from which it retrieves cordova-lib. Here is the NPM install syntax:

npm install <tarball file>
npm install <tarball url>
npm install <folder>
npm install <pkg>
npm install <pkg>@<tag>
npm install <pkg>@<version>
npm install <pkg>@<version range>

This means I can install from a tar.gz file. Great! So, I just went to this page https://www.npmjs.org/package/phonegap to check the phonegap repository and performed these steps:

  1. Download the zip of phonegap-cli repo (https://github.com/phonegap/phonegap-cli/archive/master.zip)
  2. Unzip it
  3. Open the package.json file and find the cordova-lib entry in dependencies (line 32)
  4. Change the value to 0.21.3 which is the last version.
  5. Recreate an archive of the folder to the tar.gz format
  6. Open your CLI and run this command:

    npm install -g path/to/archive/phonegap-cli-master.tar.gz
    

It should work now.

Hope that help!

这篇关于Phonegap安装错误(npm)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆