Doesn't Glitch support `type: module`? "import express" - Unexpected identifier

Hello,

Doesn’t Glitch support type: module? I have this error:

import express from "express";
       ^^^^^^^
SyntaxError: Unexpected identifier

In my example: Glitch :・゚✧

I think you need to put an “engines” section in your package.json file to make Glitch use a recent enough Node.js interpreter.

2 Likes

Thank you very much! I added this code in the package.json file:

  "engines": {
    "node": ">=14.17.6"
  }

It works now.

2 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.