What is the correct version of transformer image to use with Parcel 2?

Viewed 1857

I've installed Parcel 2, and it told me I need to use the image transformer plugin to reference an image's file location for this code:

'use strict';

import Phaser from 'phaser';
import imageUrl from "url:/art/image/rogue/Preview.png";  //  <-- here

So I npm install @parcel/transformer-image and now my package.json file looks like this:

"dependencies": {
    "@babel/plugin-proposal-class-properties": "^7.13.0",
    "@parcel/transformer-image": "^2.0.0-nightly.1981",
    "parcel": "^2.0.0-nightly.548",
    "phaser": "^3.53.1"
}

but now Parcel tells me:

@parcel/package-manager: Could not find module "@parcel/transformer-image" satisfying 2.0.0-nightly.2252+dc09f125.

>    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Found this conflicting local requirement.

What to do please?

1 Answers

You can just delete the transformer-image line from your package.json and npm and run parcel. It will download the correct version automatically.

Related