nim-lang / nimble

Package manager for the Nim programming language.
https://nim-lang.github.io/nimble/index.html
Other
1.26k stars 192 forks source link

nimble install error #885

Open srbehera opened 3 years ago

srbehera commented 3 years ago

I am getting the following errors when I run nimble install nimble. I am using pre-built binaries instead of installing nim. Any advice on how to fix these errors?

$ nimble install nimble --verbose
    Reading official package list
    Prompt: No local packages.json found, download it from internet? [y/N]
y
    Answer: Downloading Official package list
     Trying https://github.com/nim-lang/packages/raw/master/packages.json
   Warning: Downloaded packages.json file is invalid, discarding.
     Trying http://irclogs.nim-lang.org/packages.json
     Trying http://nim-lang.org/nimble/packages.json
     Error: Refresh failed
        ... Downloaded packages.json file is invalid
dom96 commented 3 years ago

That's quite odd. I just did a refresh and it worked fine. My suspicion would be that you're getting an invalid packages.json file somehow, but not sure how that is possible. Do you have any package.json files in ~/.nimble/? Can you gist them?

dom96 commented 3 years ago

Also, what version of Nimble do you have?

srbehera commented 3 years ago

I have nimble v0.12.0. I found one file named packages_temp.json and a folder named pkgs in ~/.nimble/. But both are empty. I guess it could be due to the disk quota limit in my home directory. Would it be possible to set .nimble in another directory with no disk space limit instead of home (~) directory?

dom96 commented 3 years ago

Yep, see https://github.com/nim-lang/nimble#configuration

srbehera commented 3 years ago

Thanks. I think this will help. However, there was no ~/.config/nimble/nimble.ini as I used pre-built binaries of Nim.

I also tried installing Nim from its source with replacing $HOME in the config file. But I could not successfully install as it is still trying to write to the home directory. I just posted the issues here https://github.com/nim-lang/Nim/issues/16626

dom96 commented 3 years ago

However, there was no ~/.config/nimble/nimble.ini as I used pre-built binaries of Nim.

Yes, you need to create it yourself. It won't exist no matter how you install Nim.