question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to import node module with ".js" in name

See original GitHub issue

I’m submitting a bug report

  • Library Version: 0.18.0

Please tell us about your environment:

  • Operating System: OSX 10.x|Linux (distro)|Windows [7|8|8.1|10]

  • Node Version: 6.7.0

  • NPM Version: 3.10.3

  • Browser: all

  • Language: ESNext

Current behavior: When I npm install --save-dev jump.js and later add it (“jump.js” literaly - its main property points to its only JS file) to aurelia.json build.bundles[].dependencies I get Error: ENOENT: no such file or directory, open ‘/home/powerbuoy/…/src/main/resources/static/jump.js’

If I do the same with say “moment” everything works fine.

Expected/desired behavior:

That I don’t get an error.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
EisenbergEffectcommented, Oct 3, 2016

Try using a different name in your js and in the aurelia.json mapping. Here’s an example for chart.js which has a similar problem:

         {
            "name": "chartjs",
            "path": "../node_modules/chart.js/Chart.min",
            "exports": "Chart"
          }
0reactions
powerbuoycommented, Apr 27, 2017

Ok I see, well as long as I can keep the period in the name everything works at least.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't import module into Node JS [duplicate] - Stack Overflow
I am trying to import the tradingeconomics module onto node JS, but Visual Code is underlining that part of code saying: "Could not...
Read more >
cannot find module [Node npm Error Solved] - freeCodeCamp
To fix the error, you need to install the package that is absent in your project directory – npm install package-name or yarn...
Read more >
Modules: Packages | Node.js v19.3.0 Documentation
Node.js will treat the following as ES modules when passed to node as the initial input, or when referenced by import statements or...
Read more >
Resolve the "Unable to import module" error for Lambda code ...
I receive the "Unable to import module" error when I try to run my AWS Lambda code in Node.js. Short description. You typically...
Read more >
How to resolve can't find module error in Node.js - Reactgo
If you are trying to import one local file inside another and passed a wrong path to the require() function you will see...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found