cesarvr / pdf-generator

Cordova plugin to generate pdf in the client-side
MIT License
106 stars 62 forks source link

Could not install from "node_modules/cordova-pdf-generator" as it does not contain a package.json file. #57

Closed iLGunners closed 6 years ago

iLGunners commented 7 years ago

following these steps;

image

and/or

image

getting this error;

$ cordova plugin add cordova-pdf-generator
Error: Failed to fetch plugin file:node_modules/cordova-pdf-generator via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! code ENOLOCAL
npm ERR! Could not install from "node_modules/cordova-pdf-generator" as it does not contain a package.json file.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/noshu/.npm/_logs/2017-11-30T11_16_46_455Z-debug.log

also;

$ cordova plugins add node_modules/cordova-pdf-generator
Error: Registry returned 404 for GET on https://registry.npmjs.org/nexxdeli-app

also;

$ ionic cordova plugin add cordova-pdf-generator
> cordova plugin add cordova-pdf-generator --save
Error: Failed to fetch plugin file:node_modules/cordova-pdf-generator via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! code ENOLOCAL
npm ERR! Could not install from "node_modules/cordova-pdf-generator" as it does not contain a package.json file.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/noshu/.npm/_logs/2017-11-30T11_20_37_798Z-debug.log

[ERROR] An error occurred while running cordova plugin add cordova-pdf-generator --save (exit code 1).

environment;

$ cordova -v
7.0.1
$ ionic -v
3.18.0
cesarvr commented 7 years ago

It seems you are trying to pull from a private npm repo https://registry.npmjs.org/nexxdeli-app , check you npm configuration as cordova use npm command to grap the plugin.

Cheers.

iLGunners commented 7 years ago

@cesarvr , sorry, but I didn't clearly understand what you meant. can you kindly elaborate?

biranchi2018 commented 6 years ago

Even i am also facing the same issue. There is no solution yet.

ionic -v 3.19.0

cordova -v 7.1.0

node -v v8.9.3

npm -v 5.5.1

cesarvr commented 6 years ago

I have tested the plugin by fresh installing the following: node 8.9.3 npm 5.5.1 cordova 8.0.0

And I not able to reproduce this problem.

can you try the following this steps ?

cordova create test   # create a test cordova project. 
git clone https://github.com/cesarvr/pdf-generator  # clone the plugin source code 

cd test/ # enter to the cordova created project
cordova plugin add ../pdf-generator # install the plugin, using the source code 

If everything is fine , you can try this example.

if everything works, then is some problem with your npm or cordova.

Cheers.