Unable to import node module with ".js" in name
See original GitHub issueI’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:
- Created 7 years ago
- Comments:6 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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:
Ok I see, well as long as I can keep the period in the name everything works at least.