Getting error while importing axios-curlirize on ts + node
See original GitHub issueGetting error while importing axios-curlirize,
ts-node ver. 9.1.1, typescript ver. 4.2.4
[ERROR] 14:27:26 Error: Must use import to load ES Module: node_modules/axios-curlirize/src/main.js
require() of ES modules is not supported.
require() of node_modules/axios-curlirize/src/main.js from temp.ts is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename main.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from node_modules/axios-curlirize/package.json.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Getting error while importing axios-curlirize on ts + node #43
require() of node_modules/axios-curlirize/src/main.js from temp.ts is an ES module file as it is a .js file whose nearest parent package.json contains "type": " ......
Read more >It give me error while importing axios from node module
You are using CommonJS. To import axios you could do const axios = require("axios");. Instead if you want to use ES Modules, you...
Read more >axios-curlirize - npm Package Health Analysis - Snyk
Axios third-party module to print all axios requests as curl commands in the console. This repository is forked from axios-curlirize ...
Read more >axios - npm search
Axios third-party module to print all axios requests as curl commands in the console ... and supports use with Node JS without having...
Read more >Cannot find module 'axios' Error in TypeScript | bobbyhadz
To solve the "Cannot find module `axios` or its corresponding type declarations" error, install the module by running the command `npm install axios`....
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
Thank you 👍
This needed to be a major version change, switching to ES modules is a major breaking change, now everyone and every package depending on axios-curlirize 1.x.x^ will automatically use a broken update.