Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

354
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!