Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using axios with node --experimental-network-imports #4780

Open
mataha opened this issue Jun 11, 2022 · 0 comments
Open

Using axios with node --experimental-network-imports #4780

mataha opened this issue Jun 11, 2022 · 0 comments

Comments

@mataha
Copy link

mataha commented Jun 11, 2022

Describe the issue

I would like to use axios in a simple-purpose script - without a package manager, local node_modules, any of that stuff. Node provides a way to do that through an experimental switch, by importing a module remotely over HTTPS. However, it doesn't work, and I've tried a lot of package distributors - to no avail, every time ending with a different string of errors.

Is there a way?

Example Code

#!/usr/bin/env -S node --experimental-network-imports --no-warnings

import axios from 'https://cdn.skypack.dev/axios@0.27.2';

const result = await axios.post(...);

(...)

Expected behavior, if applicable

axios is available to use through a network import, without any errors related to module loading.

Environment

  • axios 0.27.2, 1.0.0-alpha
  • nodejs 18.3.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants