I can't get the module to compile within a Typescript node project
See original GitHub issueHi,
I have a typescript node project. I’ve used NPM to install the module.
Using import { AlpacaClient, AlpacaStream } from "@master-chief/alpaca";
gives me the error below:
It appears it’s trying to use the index.js from the dist/mjs folder, although my module config in compiler options is set to use commonjs. Any idea on how I can get this working? Should I be using one of the bundles?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
Common TypeScript module problems and how to solve them
Enabling the compiler module resolution tracing in TypeScript can provide insight in diagnosing and solving problems.
Read more >`Cannot find module` for my own TypeScript module
It was a problem with the tsconfig.json of the project I was using the module in: The module property must be set to...
Read more >Compiling a TypeScript Module - TutorialsTeacher
Use the following command to compile a TypeScript module and generate the JavaScript code. If you are using IDE, then you have to...
Read more >Documentation - ECMAScript Modules in Node.js - TypeScript
This code works in CommonJS modules, but will fail in ES modules because relative import paths need to use extensions. As a result,...
Read more >How to Setup a TypeScript + Node.js Project | Khalil Stemmler
This probably doesn't come as a surprise ;) ... After we install typescript , we get access to the command line TypeScript compiler...
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 FreeTop 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
Top GitHub Comments
Sorry for the confusion! But maybe it’ll help someone that runs into a similar issue
Good call, I was on an older version of node. Updated to the most recent stable and it’s working now.