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.
Download the older version. I think there was a problem in the new one
npm install -g phonegap#3.4
I tried this and worked for me.
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:
Download the zip of phonegap-cli repo (https://github.com/phonegap/phonegap-cli/archive/master.zip)
Unzip it
Open the package.json file and find the cordova-lib entry in dependencies (line 32)
Change the value to 0.21.3 which is the last version.
Recreate an archive of the folder to the tar.gz format
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!
I had a similar problem today too on Mac, even after Lorenzo said it should be all fine. Just running this:
sudo npm install -g phonegap
... produced loads of errors like this:
error: file ./objects/pack/pack-48c0ff4147fb7e8922546c4a857b98a1cb48e01f.pack is far too short to be a packfile
I combined Lorenzo and arpan shah's solutions:
sudo npm install -g phonegap#3.4
sudo npm cache clean
sudo npm update -g phone gap
... and it seemed to magically work.
Problem
We published with a dependency on a branch of cordova-lib. This fork appears unavailable when lots of requests are coming through (I think). One way or another, it's unreliable.
Changing the dependency to 0.21.3 will cause commands to fail, but will allow the install.
Solutions
update the 'cordova-lib' dependency to the npm published version '0.21.3'
**note, this will allow the install, but other phonegap commands will fail
wait for about 20 minutes, then npm update -g phonegap
testing an update to resolve this issue
further updates momentarily
update
We've pushed version 3.5.0-0.20.3 which should resolve this issue
$ npm update -g phonegap
if that doesn't work, try
$ npm cache clean
and reinstall phonegap
I tryed above comamnds npm cache clear and reinstall phoegap. It downloaded all libs but not command line scripts (phonegap command had still 3.4 as version). I found that better was to give command: npm install -g cordova (v 3.5)!
Related
I am facing this error when I am trying to do a git push on Intellj.
It's a similar issue to this one but opposite ( That one is 'darwin-x64' binaries cannot be used on the 'darwin-arm64v8')
I have tried all the solution from that post but the git push still throwing the same error.
Below is the error I recevied when I do a git push.
Error in "/Users/xxx/Projects/cpss/node_modules/gatsby-transform
er-sharp/gatsby-node.js": 'darwin-x64' binaries cannot be used on the
'darwin-arm64v8' platform. Please remove the 'node_modules/sharp' directory and
run 'npm install' on the 'darwin-arm64v8' platform.
Error:'darwin-x64' binaries cannot be used on the 'darwin-arm64v8' platform.
Please remove the 'node_modules/sharp' directory and run 'npm install' on the
'darwin-arm64v8' platform.
I have tried to delete the node_modules/sharp and run npm install but it does not work.
Can someone explains to me how can I run npm install on 'darwin-arm64v8' platform?
Thank you.
The answer here resolved it for me:
Run brew reinstall vips. Then delete the node_modules folder and install all dependencies again (with npm install or yarn).
delete the node_modules/sharp and run npm install --arch=arm64 --platform=darwin sharp
https://sharp.pixelplumbing.com/install#cross-platform
There seems to be an issue with my windows build tools ( I already re-installed and updated it ) and I installed the gyp packages too. However Im currently stuck getting this error after trying to run the above command. What is the issue and how can I fix it?
npm config set msvs_version 2015 --global
npm install -g node-sass
running these commands in the directory solves this issue.
https://github.com/nodejs/node-gyp/issues/119#issuecomment-318609877
credit to this person.
I am having an issue with the path that my node packages are installing on Windows 8.1. Having installed node using Chocolatey I done the following steps:
Install Chocolatey
choco install npm
npm install -g grunt-cli
So having done the above I open a cmd prompt in admin mode and type 'npm', it works fine from any directory an gives me the usual npm usage stuff. Next I type 'grunt' and I get ''grunt' is not recognized as an internal or external command...'.
So straight away I think this is a PATH problem which it most likely is.
My PATH had nothing to do with npm on it, so I added 'C:\Users\MYNAME\AppData\Roaming\npm' to it, tried 'grunt' again with no luck. I looked inside 'C:\Users\MYNAME\AppData\Roaming\npm\node_modules' and nothing is installed so I ran 'npm install -g grunt-cli' again and noticed
C:\ProgramData\chocolatey\lib\nodejs.commandline.0.10.33\tools\grunt -> C:\ProgramData\chocolatey\lib\nodejs.commandline
.0.10.33\tools\node_modules\grunt-cli\bin\grunt
grunt-cli#0.1.13 C:\ProgramData\chocolatey\lib\nodejs.commandline.0.10.33\tools\node_modules\grunt-cli
├── resolve#0.3.1
├── nopt#1.0.10 (abbrev#1.0.5)
└── findup-sync#0.1.3 (lodash#2.4.1, glob#3.2.11)
So from looking at this npm is installing everything in 'C:\ProgramData\chocolatey\lib\nodejs.commandline.0.10.33\tools\node_modules' my question is should I just add this to my path and work ahead or is there something I can do to get npm to use the default install location in 'C:\Users\MYNAME\AppData\Roaming\npm' as the npm-cache in 'C:\Users\MYNAME\AppData\Roaming\npm-cache' seems to filling up as expected?
Thanks
NPM might be tool old from that package. It's my understanding they are no longer offering a separate NPM away from NodeJS (I could be incorrect here, I'd love to be wrong).
I'd prefer using the nodejs.install package (which comes with npm).
To answer your question: the location with a package version is not optimal, but I'm not sure that NPM knows a better location as of the version that is out. I don't have a good answer for you on getting NPM to look at the correct install location based on using the NPM package (which is 1.4.9). https://en.wikipedia.org/wiki/Npm_(software)
Thanks for the reply, your exactly right from my understanding. It's a problem with installing npm via chocolatey which is what I was thinking also but you clarified it.
The fix was to delete the chocolatey node_modules folders and npm from chocolatey, tidy up my PATH and then install node.js from the node.js website and npm comes packaged with that, it updated my PATH and everything now works as expected.
Thanks again!
I have Windows 7 32-bit. I installed the latest Node.js 32 bit.
When I try to run the command npm install jquery, I receive the error:
Error: ENOENT, stat 'C:\Users\RT\AppData\Roaming\npm
How does one resolve it?
Manually creating a folder named 'npm' in the displayed path fixed the problem.
More information can be found on Troubleshooting page
I ran into the same problem while installing a package via npm.
After creating the npm folder manually in C:\Users\UserName\AppData\Roaming\ that particular error was gone, but it gave similar multiple errors as it tried to create additional directories in the npm folder and failed. The issue was resolved after running the command prompt as an administrator.
This can also be fixed by installing a node package manually.
npm install npm -g
The process of doing that will setup all the required directories.
I recommend setting an alternative location for your npm modules.
npm config set prefix C:\Dev\npm-repository\npm --global
npm config set cache C:\Dev\npm-repository\npm-cache --global
Of course you can set the location to wherever best suits.
This has worked well for me and gets around any permissions issues that you may encounter.
You can go to the Start Menu and search the Node.js icon and open the shell and then install anything with
install <packagename> -g
Install a stable version instead of the latest one, I have downgrade my version to node-v0.10.29-x86.msi from 'node-v0.10.33-x86.msi' and it is working well for me!
http://blog.nodejs.org/2014/06/16/node-v0-10-29-stable/
I needed a package from github that was written in typscript. I did a git pull of the most recent version from the master branch into the root of my main project. I then went into the directory and did an npm install so that the gulp commands would work that generates ES5 modules. Anyway, to make the long story short, my build process was trying to build files from this new folder so I had to move it out of my root. This was causing these same errors.
I got lots of problem to work on v.7.x,but now I have to move my
project to a new server.so,I have to install socket.io again.
but,when I used "npm install socket.io" I got the last version.My
project using v.6.x,now I really cant install v.7.x,so,how can I
install v.6.x by NPM?
i think you can do it by
You can see listing by
npm ls socket.io
sudo npm install socket.io#0.6