Error when opening a pixi.js app in browser

I have installed pixi.js via npm into my virtual machine.

npm install pixi.js

I have succesfully imported pixi.js into my javascript file. But when I try to open up a live server, the browser does not recognize pixi.js.

Here is my code.

In app.js :

import { Application, Sprite, Assets } from "pixi.js";

const app = new Application();
await app.init();

In index.html :

<!DOCTYPE html>
<html>
    <head>
        <title>pixi.js.</title>
    </head>
    <body>
        <script type = 'module' src="app.js"></script>

    </body>
</html>

It throws out the error : Uncaught TypeError: Failed to resolve module specifier “pixi.js”. Relative references must start with either “/”, “./”, or “../”.

What am I doing wrong?