error importing axios in typescript script folder
Posted: Wed Oct 05, 2022 5:52 pm
I have created a script folder with typescript support.
When I try to import axios like
Switch gives me this error:
typescript cant find it.
I installed axios with and the folder is in node_modules. I know the default export of axios has the same name "axios".
I dont get any errors by transpiling. Iam completely lost here.... really unproductiv day so far.
Freddy please help. Would you?
When I try to import axios like
Code: Select all
import axios from 'axios';
If I change the import torequire() of ES Module C:\Users\Administrator\Documents\Skripte\App\node_modules\axios\index.js from C:\Program Files\Enfocus\Enfocus Switch\ScriptExecutor\NodeScriptExecutor.js not supported. Instead change the require of index.js in C:\Program Files\Enfocus\Enfocus Switch\ScriptExecutor\NodeScriptExecutor.js to a dynamic import() which is available in all CommonJS modules.
Code: Select all
import {axios} from 'axios';
I installed axios with
Code: Select all
npm i --save axios
I dont get any errors by transpiling. Iam completely lost here.... really unproductiv day so far.
Freddy please help. Would you?