freyr-js icon indicating copy to clipboard operation
freyr-js copied to clipboard

TypeError: 'binary' and 'semverRange' arguments required in npm when installing

Open capeguy63 opened this issue 2 years ago • 3 comments

I wanted to update freyr so I used 'npm install -g freyr', encountering this error

npm WARN config global --global, --local are deprecated. Use --location=global instead. npm WARN deprecated [email protected]: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau npm WARN deprecated [email protected]: Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at https://github.com/visionmedia/superagent/releases. npm ERR! code 1 npm ERR! path C:\Users\AppData\Roaming\npm\node_modules\freyr\node_modules\youtube-dl-exec npm ERR! command failed npm ERR! command C:\Windows\system32\cmd.exe /d /s /c C:\Users\AppData\Local\Temp\preinstall657746947545.cmd npm ERR! npm WARN config global --global, --local are deprecated. Use --location=global instead. npm ERR! npm WARN config global --global, --local are deprecated. Use --location=global instead. npm ERR! TypeError: binary and semverRange arguments required npm ERR! at binaryVersionCheck (file:///C:/Users//AppData/Local/npm-cache/_npx/7b761a280cf4a94b/node_modules/bin-version-check/index.js:7:9) npm ERR! at file:///C:/Users//AppData/Local/npm-cache/_npx/7b761a280cf4a94b/node_modules/bin-version-check-cli/cli.js:28:1 npm ERR! at ModuleJob.run (node:internal/modules/esm/module_job:198:25) npm ERR! at async Promise.all (index 0) npm ERR! at async ESMLoader.import (node:internal/modules/esm/loader:385:24) npm ERR! at async loadESM (node:internal/process/esm_loader:88:5) npm ERR! at async handleMainPromise (node:internal/modules/run_main:61:12)

Please help me solve this problem. Love your program! Thank you so much!

capeguy63 avatar Jul 13 '22 21:07 capeguy63

I haven't seen this error before, but it seems it's already providing you a solution.

npm WARN config global --global, --local are deprecated. Use --location=global instead.

So, instead of npm install -g freyr You can try npm install --location=global freyr

miraclx avatar Jul 16 '22 01:07 miraclx

I see you're on Windows. So this might help: https://stackoverflow.com/a/72526849/9806233

miraclx avatar Jul 16 '22 01:07 miraclx

I tried it again, still encountering the same error. From what im reading, the error is a command in youtube-dl-exec. Sorry but I do not have enough python knowledge to know where's the problem

capeguy63 avatar Jul 16 '22 10:07 capeguy63

Hi @capeguy63, can you check if the latest master works fine for you?

miraclx avatar Aug 10 '22 01:08 miraclx

Hi! Nope, it is still stuck for me, but at a new error. I tried finding out how to fix it but couldnt find any instructions for windows. Not sure if this is an error from youtube-dl-exec, and not sure if you can help

npm ERR! code 1
npm ERR! path C:\Users\Glen\AppData\Roaming\npm\node_modules\freyr\node_modules\youtube-dl-exec
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c C:\Users\\AppData\Local\Temp\preinstall-74aebe64.cmd
npm ERR! Error: Couldn't find version of `python3`
npm ERR!     at binaryVersion (file:///C:/Users//AppData/Local/npm-cache/_npx/7b761a280cf4a94b/node_modules/bin-version/index.js:55:8)
npm ERR!     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
npm ERR!     at async binaryVersionCheck (file:///C:/Users//AppData/Local/npm-cache/_npx/7b761a280cf4a94b/node_modules/bin-version-check/index.js:14:18)

capeguy63 avatar Aug 11 '22 00:08 capeguy63

It's stuck for a different reason now. Do you have python installed? What happens when you type python3 in your terminal?

miraclx avatar Aug 11 '22 01:08 miraclx

Yeap i have python installed. But when i type python3, microsoft store to python 3.10 appears. I have tried finding out how to fix this but i cant find anything

Python 3.10.5 (tags/v3.10.5:f377153, Jun  6 2022, 16:14:13) [MSC v.1929 64 bit (AMD64)] on win32

capeguy63 avatar Aug 11 '22 03:08 capeguy63

But when i type python3, microsoft store to python 3.10 appears

is it asking you to install python 3.10? or what exactly? might help if you included screenshots.

But freyr requires the python3 command to be available in your path. Once that requirement is fulfilled, it should work.

miraclx avatar Aug 11 '22 05:08 miraclx

Yeap, it is asking me to install python 3.10 from the microsoft store. But i have already installed from python website.

Do you know how to put python3 command to path? I know how to put a command to path but im not sure how to put python as python3.

I actually did not have these errors before when I was using an earlier version of freyr. Not sure why all these errors are popping out now

capeguy63 avatar Aug 11 '22 07:08 capeguy63

freyr depends on youtube-dl-exec, which just migrated it's internal dependency from youtube-dl to yt-dlp which by default, exclusively uses python3 instead of the more generic python command. That's why you're having this issue now. And it didn't come up before.

miraclx avatar Aug 11 '22 07:08 miraclx

You said you installed python already. How do you run it in your console? python?

miraclx avatar Aug 11 '22 07:08 miraclx

This is how i check python on my cmd.

C:\Users\>python
Python 3.10.5 (tags/v3.10.5:f377153, Jun  6 2022, 16:14:13) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

I believe it is installed properly, if not i will have problems even running npm.

Thanks so much in advance for assisting me so far!!

capeguy63 avatar Aug 11 '22 09:08 capeguy63

Hi miraclx, I actually managed to fix it. I uninstalled python, and reinstalled from microsoft store. Weird way but oh wells. So freyr is now working for me again. Thank you so much!!

capeguy63 avatar Aug 11 '22 11:08 capeguy63