Parcel: --no-autoinstall not working because of capitalization typo in source

Created on 4 Apr 2019  路  7Comments  路  Source: parcel-bundler/parcel

馃悰 bug report

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.

馃 Expected Behavior

--no-autoinstall should work

馃槸 Current Behavior

--no-autoinstall is ignored

馃拋 Possible Solution

Rewrite Parcel in TypeScript and catch bugs like these at compile-time 馃槈

馃敠 Context

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.

馃實 Your Environment

| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.12.3
| Node | v11.4.0
| Yarn | v1.12.3
| Operating System | Windows 10 x64

Good First Issue Bug Confirmed Bug

Most helpful comment

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

All 7 comments

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.

2898

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.

Was this page helpful?
0 / 5 - 0 ratings