Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

362
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda