Disabling automatic package guessing and installing

I believe automatic installation is a valuable feature for Replit. However, I also believe that having the option to manually install only the components we need is important. This is because, at times, certain library versions may lack stability and could conflict with other libraries.

3 Likes

Totally! We recently added a way to turn off automatic installation and guessing:

You can add either of these to your .replit file to bypass these automatic things:

disableGuessImports = true
disableInstallBeforeRun = true
1 Like

where will i exactly put these here?

disableGuessImports = true
disableInstallBeforeRun = true

is this correct?

{ pkgs, ... }: {
  deps = [
    pkgs.nano
    pkgs.run
    pkgs.ffmpeg
   disableGuessImports = true

  ];
  environment.systemPackages = [ pkgs.libopus ];
}

You’ve put them in the replit.nix file, instead find the .replit file and you should be able to just paste them at the bottom. :smile:

that is nix file .replit has different format and content

It is likely you cannot put them at the bottom of .replit because the TOML sections. They need to be in the top level, so put them near the top before all of the square bracket sections like [nix].

1 Like

is this correct?

{ pkgs, ... }: {
  disableGuessImports = true
  deps = [
    pkgs.nano
    pkgs.run
    pkgs.ffmpeg
    

  ];
  environment.systemPackages = [ pkgs.libopus ];
}

No. This line needs to be added to the .replit file not the replit.nix file.

Like this:

https://replit.com/@ryantmreplit/Disable-Guess-Imports?s=app

Also, environment.systemPackages is specific to NixOS and shouldn’t be there.

3 Likes