In cli.js an option called --no-autoinstall produces a value in the final options object called autoinstall, while in Bundler.js the normalizeOptions function expects a value called autoInstall. Since autoInstall is never declared, the auto install feature cannot be disabled via the flag as expected.
--no-autoinstall should work
--no-autoinstall is ignored
Rewrite Parcel in TypeScript and catch bugs like these at compile-time 馃槈
Jokes aside, I'd like to use this opportunity to emphasize that, while I am personally a big advocate of "powerful aggressive defaults", I think that auto-installing arbitrary packages (especially where developer typos are guaranteed) is more harmful than helpful, at least not by a sheer import. Perhaps the feature could somehow check if any of the API was actually used after the import... but even then, that would be quite the complicated feature.
| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.12.3
| Node | v11.4.0
| Yarn | v1.12.3
| Operating System | Windows 10 x64
I know there is a bigger question here around defaults, however, I have got a simple fix PR up so people can continue to use the feature in the time being.
Is there a current work around for this issue until the new release?
My local dev environment is currently broken due to parcel watch --no-autoinstall attempting and failing to download my custom module from npm; thus, refusing to actually build the project.
I had been editing the source in node_modules which isn't great since any npm or yarn commands overwrite your changes, but you might have some luck with environment variables, since it looks like Bundler.js sets the autoInstall feature based on some environment stuff as another level of configuration: https://github.com/parcel-bundler/parcel/blob/636bb50baeae15730c3b91cd3b58b457c31f7200/packages/core/parcel-bundler/src/Bundler.js#L147
In case someone came across this, I followed @SirUppyPancakes 's advice set up the env var with cross-env package and everything works as expected!
cross-env PARCEL_AUTOINSTALL=false parcel examples/index.html
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.
This seems to still be an issue.
yes still broken.
Most helpful comment
I had been editing the source in
node_moduleswhich isn't great since anynpmoryarncommands overwrite your changes, but you might have some luck with environment variables, since it looks likeBundler.jssets theautoInstallfeature based on some environment stuff as another level of configuration: https://github.com/parcel-bundler/parcel/blob/636bb50baeae15730c3b91cd3b58b457c31f7200/packages/core/parcel-bundler/src/Bundler.js#L147