SwapnilSoni1999 / spotify-dl

Spotify Downloader and alternative of Spotdl(python) tool made in NodeJS based on youtube-dl
MIT License
1.36k stars 145 forks source link

ERR_UNSUPPORTED_ESM_URL_SCHEME #146

Closed retrogradeorbit closed 2 years ago

retrogradeorbit commented 2 years ago

Describe the bug Program exits with error: ERR_UNSUPPORTED_ESM_URL_SCHEME

$ ~/.nvm/versions/node/v12.18.2/bin/spotifydl
(node:17350) ExperimentalWarning: The ESM module loader is experimental.
internal/modules/run_main.js:54
    internalBinding('errors').triggerUncaughtException(
                              ^

Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader
    at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:727:11)
    at Loader.resolve (internal/modules/esm/loader.js:97:40)
    at Loader.getModuleJob (internal/modules/esm/loader.js:243:28)
    at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:46:40)
    at link (internal/modules/esm/module_job.js:45:36) {
  code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME'
}

To Reproduce Steps to reproduce the behavior:

  1. install programme with npm install -g spotify-dl
  2. execute the program

Expected behavior The program should run

Desktop (please complete the following information):

2V3EvG4LMJFdRe commented 2 years ago

Same on macOS High Sierra.

phyzical commented 2 years ago

hey @retrogradeorbit and @2V3EvG4LMJFdRe

Thanks for the issue, i think the issue may be the node version? its working for myself on node 14.

But i have posted a pr to update the readme to help others.

Feel free to let me know if node 14 does not fix the issue.

2V3EvG4LMJFdRe commented 2 years ago

Thank you, it's fixed after I updated node and npm on my mac.

phyzical commented 2 years ago

hey @2V3EvG4LMJFdRe what is the output for node --version

2V3EvG4LMJFdRe commented 2 years ago

v17.4.0 @phyzical

phyzical commented 2 years ago

@2V3EvG4LMJFdRe thanks, i would suggest just reinstalling your node if your not super familiar with how it all works, another options is to use something like nvm (https://github.com/nvm-sh/nvm)

OH also you shouldn't need to checkout the repo to install this project,

npm install -g spotify-dl should suffice

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 2 years ago

This issue has been automatically closed as stale due to lack of activity, Please reopen if you think this needs to be