Search code examples
deploymentpathnetlify

Netlify CLI deploy command always asks for path


I used to have a file named .netlify which didn't work after their cli update.

Now it created this folder and file. The problem is that when I do netlify deploy it always asks for the deploy path even though I have it in the configuration...

any ideas?

.netlify/state.json:

{   
    "path": "dist",
    "siteId": "..."
}

Solution

  • The Nelify CLI looks for settings locally from two spots as stated in the docs

    Flags

    netlify deploy --dir dist

    netlify.toml File (in project root)

    [build]
      publish = "dist"
    

    NOTE: They will search in that order, so the command line flags will override what is in the netlify.toml file. Make sure you are using the latest version of the CLI.