Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

360
Vistas
Published ES modules in an npm package, can't import

I'm trying to use an npm package that I published. I have it installed and the files are present and up to date in node_modules, but when I try to import it like so:

import Message from 'discord-helper-lib';

I get the following error:

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'C:\path\to\code\node_modules\discord-helper-lib' imported from C:\path\to\code\api\GameUpdater.js

The package itself has the following package.json:

{
    "name": "discord-helper-lib",
    "version": "2.0.2",
    "description": "Discord Helper Library",
    "type": "module",
    "scripts": {},
    "dependencies": {
        "emoji-regex": "^9.2.2"
    }
}

and the class I'm trying to import is defined as follows:

export default class Message {
    constructor(text, messageReplyDetails) {
           //..
    }
}

Is there anything else I have to do to set up a module as an npm package to import it like others? Not sure if there's configuration or other requirements4

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda