Search code examples
npmparceljs

How can I display my index.html using parcel?


I would like to display a project I am working on with parcel by typing parcel index.html

parcel charges then display this error message :

  • 29 | "@parcel/transformer-sass": "^2.0.0-beta.2",
  • 30 | "@parcel/transformer-vue": "^2.0.0-beta.2",
  • | ^^^^^^^^^^^^^^^^^^^^^^^^^ Found this conflicting local requirement.
  • 31 | "@vue/component-compiler-utils": "^3.2.0",
  • 32 | "sass": "^1.26.10",

Thanks for your help!


Solution

  • There are a variety of things that can cause this error, and it's impossible to say exactly what you need to do what without a more specific repro.

    However, a little background information about where this error comes from could give you some pointers about where to look / what to try.

    Parcel has a feature that will automatically install the dependencies that it needs using npm, yarn or pnpm. For example, suppose you add a .sass file to your project, but have not yet installed @parcel/transformer-sass - parcel tries to detect this and install it automatically. When it works, it's pretty magical, but when it goes wrong, you'll see errors like this.

    Two things you can do to possibly fix or work around this error:

    1. Make sure the versions of all parcel-related packages you have installed are aligned. (I see, for example, that you have lots of 2.0.0-beta.2 packages - now that 2.0.0 is released, upgrade to that (or whatever the current version of parcel is in the future).
    2. As a last resort, try disabling auto-install by setting --no-autoinstall cli flag (see docs). You might still get other errors if there are plugins that are required that are not yet installed, but they might be more specific.