Comments (9)
@NateEag Actually we will be dropping support for npm@<5
in the next major. The code you referenced has already been removed in #80.
@misterti No, unfortunately there's no built-in way of getting even more verbose output. You could patch the version of cordova-fetch
used by your cordova
installation to log npmInstallOutput
here:
Lines 93 to 94 in d2be930
Or maybe you could just try installing what you are trying to install using npm install
then you should be seeing any unmet dependency warnings.
from cordova-fetch.
or at least how can i see the underlying error
Attaching --verbose
flag to any cordova command should spit out a lot of potentially useful debug information, including information from stdout of spawned processes.
Also a side note that support for NPM 3 is ending in the next major, which is already committed to master. So if there are any issues regarding NPM 3, it will likely be no longer addressed. You should consider upgrading if possible.
from cordova-fetch.
Do we have a workaround, or at least how can i see the underlying error, what is the unmet dependency?
Thanks
from cordova-fetch.
In my project I actually wound up removing the plugin that caused the error for unrelated reasons.
@breautek Thanks for the heads-up about npm 3. If you look at the code in question, you'll see a comment claiming that it also applies with npm 4.
As I said above, I haven't tested that, but it seems likely to me this bug will exist there too.
from cordova-fetch.
Verbose still doesn't give any usable information. I get module_not_found from async.js and then unmet\package.json at the end. Can i get even more verbose output from each step of cordova plugin add?
from cordova-fetch.
@raphinesse Gotcha, thanks. Good to know.
from cordova-fetch.
@raphinesse thanks, that worked perfectly. I dumped the npmInstallOutput and got all the info i needed. Doing npm install did not fail. I think a step after failed.
console.log(dump(npmInstallOutput));
where dump() is a copy from http://www.openjs.com/scripts/others/dump_function_php_print_r.php
Edit: npm install actually returns a warning for unmet peer dependencies and that breaks further steps of cordova plugin add, when it should return the module name. So i patched getTargetPackageSpecFromNpmInstallOutput and i want to share this for other poor souls suffering from this.
function getTargetPackageSpecFromNpmInstallOutput (npmInstallOutput) {
//console.log("dump(npmInstallOutput));
const lines = npmInstallOutput.split('\n');
for (let i = 0; i < lines.length; i++) {
if (lines[i].indexOf('UNMET') > -1)
continue;
if (lines[i].startsWith('+ ')) {
// npm >= 5
return lines[i].slice(2);
} else if (lines[i].startsWith('└─') || lines[i].startsWith('`-') || lines[i].startsWith('+-')) {
// 3 <= npm <= 4
return lines[i].slice(4).split(' ')[0];
}
}
throw new CordovaError('Could not determine package name from output:\n' + npmInstallOutput);
}
Sorry for code formatting, it just won't work
Edit: fixed, thanks breautek
from cordova-fetch.
Sorry for code formatting, it just won't work
For future reference, you can do block-level formatting by using 3 backticks ( ``` ) followed by a new line, using another 3 backticks on a new line to end the block.
from cordova-fetch.
I am closing out this ticket as we do not support npm 3.
from cordova-fetch.
Related Issues (20)
- cordova cannot add plugins from git (CordovaError: Error: An unknown git error occurred) HOT 15
- coho audit-license-headers issues in cordova-fetch HOT 4
- cordova-fetch patch release August 2018 HOT 1
- Incorrect module ID in case of certain URL patterns HOT 3
- Support node recursive module resolution algorithm HOT 2
- Detect which package manager to invoke HOT 5
- How to handle `save: true` when requested package is already installed HOT 5
- cordova-fetch is much slower at prepare HOT 26
- Private repository and UNMET DEPENDENCY HOT 3
- Install a cordova plugin by tagged version from a custom git repo fails HOT 2
- Adding Cordova plugins is much slower HOT 1
- Too slow donwloading/installing plugins HOT 1
- Fails to get the installed target package name HOT 1
- Save platforms and plugins to devDependencies HOT 5
- CordovaError: Could not determine package name from output HOT 9
- Cannot determine package name from spec git+https://github.com... HOT 10
- [email protected] -> [email protected] breaks plugin installs using git repos or local directories HOT 10
- cordova-android referencing git repo is changed to npm package version when performing a release build HOT 7
- cordova prepare : failed to fetch plugins with github spec with npm@7 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-fetch.