I’ve got a Vue application I’m deploying to Netlify via the CLI. I did not use netlify init
because the CLI noticed it was part of a GitHub repo and forced me to associate the site with the repo. In my case, the site I wanted to deploy was a subdirectory of the GitHub repo and I didn’t want the association. I was fine w/o CI.
So I used netlify deploy
and selected to make a new site. That worked, but my site didn’t deploy right because I didn’t specify a build command.
In the Netlify admin, I noticed I was not allowed to specify a build command. Maybe it’s only allowed when CI is used? So I decided to make a netlify.toml file instead and just specify it there.
I ran netlify deploy
again and it didn’t know I had already connected it to a site. I’m not sure why the first time I ran it didn’t work. I mean it did make a site and all but nothing was configured right locally. Anyway I told the CLI to connect to an existing site. I picked the one I created moments earlier and then got this output:
This folder isn't linked to a site yet
? What would you like to do? Link this directory to an existing site git directory located in /mnt/c/projects/vue-demos netlify link will connect a site in app.netlify.com to this folder
? How do you want to link this folder to a site? Choose from a list of your sites ? What is the name of the site? nps-gallery Directory Linked Admin url: https://app.netlify.com/sites/nps-gallery Site url: https://nps-gallery.netlify.com Site id saved to /mnt/c/projects/vue-demos/nps_gallery/.netlify/state.json You can now run other `netlify` cli commands in this directory
Please provide a deploy path relative to:
/mnt/c/projects/vue-demos/nps_gallery
? deploy path /mnt/c/projects/vue-demos/nps_gallery Deploy path: /mnt/c/projects/vue-demos/nps_gallery Configuration path: /mnt/c/projects/vue-demos/nps_gallery/netlify.toml Deploying to live site URL...
✔ Finished hashing 18 files 🚶 CDN diffing files... › Warning: › {} › Error: Missing required param site_id
at ~/.nvm/versions/node/v12.9.0/lib/node_modules/netlify-cli/node_modules/netlify/src/open-api/index.js:34:15 at Array.forEach (<anonymous>)
at NetlifyAPI.createSiteDeploy (~/.nvm/versions/node/v12.9.0/lib/node_modules/netlify-cli/node_modules/netlify/src/open-api/index.js:28:43)
at module.exports (~/.nvm/versions/node/v12.9.0/lib/node_modules/netlify-cli/node_modules/netlify/src/deploy/index.js:77:26)
at async NetlifyAPI.deploy (~/.nvm/versions/node/v12.9.0/lib/node_modules/netlify-cli/node_modules/netlify/src/index.js:108:12)
at async DeployCommand.run (~/.nvm/versions/node/v12.9.0/lib/node_modules/netlify-cli/src/commands/deploy.js:144:17) at async DeployCommand._run (~/.nvm/versions/node/v12.9.0/lib/node_modules/netlify-cli/node_modules/@oclif/command/lib/command.js:44:20)
at async Config.runCommand (~/.nvm/versions/node/v12.9.0/lib/node_modules/netlify-cli/node_modules/@oclif/config/lib/config.js:151:9)
at async Main.run (~/.nvm/versions/node/v12.9.0/lib/node_modules/netlify-cli/node_modules/@oclif/command/lib/main.js:21:9)