To provide a bit of background here, there are several reasons that 
`--no-fetch` will not be coming back, but I *believe* what we want to 
accomplish should be compatible with Yarn.

The old installation code was unfortunately tied to npm2, which is several 
years old and relies on versions of dependencies with known security 
vulnerabilities. Because npm2 was installed as a dependency, running npm 
scripts within projects using Cordova would run with npm2 rather than the 
system npm. This was a frequent source of problems for users of Cordova, 
because npm2 and npm3 have different behaviour around peerDependencies.
The previous code was also doing custom behaviour that bypassed npm's caching 
helpers, didn't perform all the same verifications on the downloaded packages 
(which meant packages could get corrupt, and stick around), and was essentially 
us trying to poorly replicate a bunch of npm's behaviour. The code was 
unmaintainable and a source of continued bugs.

The way forward for Cordova is to have platforms and plugins listed in 
package.json and installed into node_modules. When you ask Cordova to install 
something, it will use npm to install it **if it is not already installed**.

>From what I understand, this means it should be possible to make this work 
>with Yarn, but you'll need to add the platforms to your package.json manually, 
>and install them with Yarn.

For instance, with the following in your package.json:
```json
{
  "dependencies": {
    "cordova-android": "^7.1.0"
  },
  "cordova": {
    "platforms": [
      "android"
    ]
  }
}
```

After you run `yarn install`, you should be able to run `cordova prepare` (on 
the nightly build) to create the `platforms/android` folder without npm being 
invoked.

[ Full content available at: https://github.com/apache/cordova-cli/issues/303 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to