rohfosho / CordovaCallNumberPlugin

Call a number directly from your cordova application.
MIT License
185 stars 151 forks source link

Error when I'm trying to install plugin using npm #47

Open Sudalaiyandi opened 7 years ago

Sudalaiyandi commented 7 years ago

I have added this plugin in ionic app using command. $ ionic cordova plugin add call-number $ npm install --save @ionic-native/call-number. Then i commit my ionic app in git.After i checkout my application from git, then i installed npm install.I got this error like this. npm ERR! code E404 npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/mx.ferreyra.callnumber npm ERR! 404 npm ERR! 404 'mx.ferreyra.callnumber' is not in the npm registry. npm ERR! 404 You should bug the author to publish it (or use the name yourself!) npm ERR! 404 It was specified as a dependency of 'ionic-hello-world' npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, http url, or git url.

How can i solved this issue ?

smiklakhani commented 7 years ago

I was having the same issue. I believe whoever's in charge of the npm registry for this project needs to address this. Adding the call-number plugin (like you showed in your description) results in 'mx.ferreyra.callnumber' being added as a dependency, even though the package isn't registered as such on npmjs.org.

A temporary fix would be to just remove 'mx.ferreyra.callnumber' from package.json after running 'ionic cordova plugin add call-number' (leave 'call-number', which also gets added, in there).

Sudalaiyandi commented 7 years ago

In package.json, i modified mx.ferreyra.callnumber to call-number.Then i install npm, now project is running successful.This is also temporary fix to my app, which you have done.That bug should be rectify only by author.

mohamedsharaf commented 7 years ago

@Sudalaiyandi

i did like what u said with no luck to get it work

any fix for the iinstall problem

smiklakhani commented 7 years ago

@mohamedsharaf are you still getting the same error? "npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/mx.ferreyra.callnumber"

If so, there's still something in your package.json file that's referencing mx.ferreyra.callnumber. Search for that dependency and make sure it's removed.

pvanhemmen commented 7 years ago

I can confirm the problem. Another problem is, with every cordova target build it also gets added back in to the package.json.

mrs110 commented 7 years ago

This is the same error as #43 #26 . They have been open for a while. Is there anybody maintaining this repo?

shyamal890 commented 7 years ago

Does one need to change reference to mx.ferreya.callnumber in config.xml?

smiklakhani commented 7 years ago

I don't believe I had to remove or change that reference in order to get the build working - removing it from package.json alone did the trick.

ppetree commented 7 years ago

I use this off github instead of npm with no problems. My config.xml looks like this:

<plugin name="CordovaCallNumberPlugin" spec="https://github.com/Rohfosho/CordovaCallNumberPlugin" />

And I agree... is anyone maintaining this?

shyamal890 commented 7 years ago

@Rohfosho Can you please address this issue. It's causing a huge headache on each npm install

mohamedsharaf commented 7 years ago

use this fixed the problem for me

remove the plugin call number and any reference for it also remove mxfree from package,json

then install through

npm install call-number

veljkocasa commented 7 years ago

@Rohfosho why you closed this ? Can you provide working usecase? Do we have ts types somewhere? How to import it to page when we use just npm install ?

shyamal890 commented 7 years ago

@Rohfosho Is this problem solved?

QiaoyuanMaxDeng commented 6 years ago

I have it building successfully. I removed mx.ferreyra.callnumber from package.json and config.xml in all places and it is building correctly with @ionic-native/call-number. This is because I noticed ionic-native/call-number has the content of mx.ferreyra.callnumber does. So in summary:

  1. install the ionic-native/call-number as it suggests here, https://ionicframework.com/docs/native/call-number/
  2. build the app
  3. remove mx.ferreyra.callnumber from package.json and config.xml in all places
Sampath-Lokuge commented 6 years ago

I just removed it from the package.json file. After that deleted the node_modules folder. Then npm i. Now no issues.

CK110 commented 6 years ago

change the codova plugin ionic cordova plugin add cordova-plugin-call-number, it's work

BradyNadeau commented 6 years ago

Here is what I did for the Cordova "AfterPluginInstall" Hook

"use strict";

var fs = require('fs');
var path = require('path');

/**
 * This is here because the cordova plugin "Call-Number" adds a NPMJS Dependency that in non-existant on npmjs.com and will break the builds.
 * https://github.com/Rohfosho/CordovaCallNumberPlugin/issues/47
 */
module.exports = function (context) {
    console.log("after plugin install..... ");
    console.log("context.opts.plugin.id: " + context.opts.plugin.id);

    if (context.opts.plugin.id == "mx.ferreyra.callnumber") {

        var encoding = 'utf-8';
        var srcPackageJsonPath = path.join(context.opts.projectRoot, 'package.json');
        var packageJson = JSON.parse(fs.readFileSync(srcPackageJsonPath, encoding));
        delete packageJson.dependencies['mx.ferreyra.callnumber'];
        fs.writeFileSync(srcPackageJsonPath, JSON.stringify(packageJson), encoding);
    }

};
shyamal890 commented 6 years ago

@Rohfosho Can you please explain why these issues are troubling the users?!

rohfosho commented 6 years ago

Hi Everyone, I haven't used this plugin in a little while. If anyone wants to submit a PR with a fix, I'm more than happy to merge it into master.

theHellyar commented 6 years ago

this fixed my issues of always wanting to install the 'mx.ferreyra.callnumber'

just remove all plugins 'mx.ferreyra.callnumber' and 'call-number'

then past this in your config file: <plugin name="call-number" spec="1.0.4" />

then run ionic cordova prepare and it will install the latest version and the console will never try to install 'mx.ferreyra.callnumber ' again.... happy days!

misanche commented 6 years ago

Just do this to solve the issue:

  1. cordova plugin add https://github.com/Rohfosho/CordovaCallNumberPlugin.git
  2. npm install --save @ionic-native/call-number
mubasshir commented 6 years ago

Thanks @CK110

0ctober commented 5 years ago

A tricky solution found here https://github.com/ionic-team/ionic/issues/11252 (the last post) is :

myCallFunction(numberToCall:string):void{ window.open('tel:' + numberToCall, '_system') }

meanstack-perficient commented 5 years ago

This issue is plaguing commercial build processes everywhere. The npm registry is not in sync with the plugin name/id in the platform plugins config for ios or android and the prepare keeps adding a bogus plugin to any build phase prepare build run or repair

someone has to intervene and take the whole plugin down until its resolved

accepting a plugin under these circumstances is bizarre maybe the administrator vanished

at least take the github repo and refabricate it so the names are in sync to prevent opensource impact

ppetree commented 5 years ago

This plugin was forked and I think it was called callnumber1 and that for is being maintained. Also, this plugin exists: https://github.com/oneserve/CordovaCallNumberPlugin#readme