Can't deploy Shopify function written in Rust

I’m following the instructions here but keep getting the error below on deploy:

npm run deploy

I didn’t change any code and just took the steps. Any idea how to fix this?

Hello @ijam ,

Greetings from SynapseIndia, and we are glad to help you today.

Please consider below points once:-

  1. Make sure commands are run under correct app directory.

  2. Make sure cargo and rust version are updated , consider updating & re-installing both with updated version & then follow the complete steps from start.

Happy to answer any other queries you may have.

If you find my solution helpful, please do hit Like and Mark as Solution

Best Regards,

Animesh Sharma

You have to add path .cargo/bin to the environment variable.

  • Find your Rust installation path (usually in %USERPROFILE%.cargo\bin).
  • Add this path to the environment variables:
    1. Press Win + R, type control sysdm.cpl, and hit Enter.

    2. Go to the Advanced tab and click on Environment Variables.

    3. In the System variables section, find the Path variable and click Edit.

    4. Click New and add the path to Cargo’s bin directory, e.g., C:\Users\YourUsername.cargo\bin.

    5. Click OK to save the changes.

      Restart the terminal or the code editor.