I am trying to deploy a Python script that requires external libraries from a windows machine. I have tried using a .sh build script like in all of the digital ocean sample repos. But that gives me an error that build.sh won’t run on this platform, and no build.cmd is provided. So I try to replace it with a build.cmd but it gives me json decoding error in my logs.
This is the final output it gives me Error: While deploying action ‘test-slack-2/test’ (running remote build): Expecting value: line 1 column 1 (char 0)
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Click below to sign up and get $200 of credit to try our products over 60 days!
Hi thank you for the help and quick response. But that didn’t work my VS code environment already uses LF and when I ran the build.sh through dos2unix it still gave me the error below.
‘build.sh’ won’t run on this platform and no ‘build.cmd’ is provided
And trying to run dos2unix on build.cmd gives the same error as well.
(running remote build): Expecting value: line 1 column 1 (char 0)
It sounds the issue might be related to newline characters in your script files. Windows and Linux use different newline characters: Windows uses
\r\n(carriage return and line feed), while Linux uses
To resolve this issue, you can try converting your build script and other relevant files to use the appropriate newline characters for your target platform (Linux in your case).
Here are a couple of ways to convert newline characters:
Using a text editor: Many text editors, such as Notepad++, Visual Studio Code, or Sublime Text, allow you to change the newline characters’ format. You can usually find this option in the editor’s settings, preferences, or status bar. Look for “Line Endings” or “EOL Conversion” and change it to “Unix (LF)”.
dos2unixtool: If you have access to a Unix-based system or WSL (Windows Subsystem for Linux) on your Windows machine, you can use the
dos2unixtool to convert the newline characters. To use
dos2unix, install it first, and then run the following command:
build.shwith the name of your script file. This command will convert the newline characters in the file to Unix-style line endings.
After converting the newline characters, try deploying your Python script again.
Let me know how it goes!