Getting error: /bin/sh scriptcs: command not found
Asked Answered
J

2

14

I'm using Visual Studio Code for Mac, running extension CodeRunner. I've got a simple program:

using System;
namespace HelloWorldApplication {
class HelloWorld {
   static void Main(string[] args) {
      Console.WriteLine("hellowol");
   }
 }
}

When I run it using the play button in the upper right hand corner I get the following error:

/bin/sh scriptcs: command not found

Then

[Done] exited with code=127 in 0.008 seconds

The program does not show the desired output.

EDIT: Much thanks to @VonC. His approach worked. Pro tip for anyone: install scriptcs using

brew install scriptcs
Jehoshaphat answered 20/8, 2018 at 3:39 Comment(0)
H
8

Considering the prerequisite for filipw/vscode-scriptcs-runner is:

scriptcs should be installed on your machine.

Make sure to launch VSCode from a shell session where scriptcs is in your $PATH (meaning which scriptcs does not return an empty output)

Hunchbacked answered 20/8, 2018 at 4:43 Comment(13)
thanks so much for helping. This fixed it but now I have a new error: Unexpected named argument: Users/jfitz/Projects/Projtest/test.csJehoshaphat
@Jehoshaphat That would be better asked as a separate question.Hunchbacked
Will do in 90 minutes, when I can post questions.Jehoshaphat
@Vonc Hi VonC I am sorry to disturb you, I find similar issue, I run "which scriptcs" it gives me /usr/local/bin/scriptcs. And I start Visual code from a shell session by running following command: "/Applications/Visual\ Studio\ Code.app/Contents/MacOS/Electron", but when I run the code it still displays this error. Could you advise? Thanks a lot.Guttersnipe
@HuibinZhang Electron? VSCode should be launched by typing code. See code.visualstudio.com/docs/editor/command-line and code.visualstudio.com/docs/setup/mac. See if the issue persists when VSCode is launched that way.Hunchbacked
@Vonc thanks for kind reply. I will try this and let you know:)Guttersnipe
@HuibinZhang Since it is still failing, try and display PATH within vscode (using a console)Hunchbacked
@Vonc hi I tried display PATH it looks like this: C02RW5PQG8WN:~ i333417$ which scriptcs /usr/local/bin/scriptcs C02RW5PQG8WN:~ i333417$ scriptcs "/var/folders/sr/5jzw91rn4g3cc2b0xyhw0j100000gq/T/tempCodeRunnerFile.csharp" Unexpected named argument: var/folders/sr/5jzw91rn4g3cc2b0xyhw0j100000gq/T/tempCodeRunnerFile.csharp C02RW5PQG8WN:~ i333417$Guttersnipe
@Vonc Hi it still display command not found. I mean I tried copy "/var/folders/sr/5jzw91rn4g3cc2b0xyhw0j100000gq/T/tempCodeRunnerFile.csharp" statement and paste to terminal to run, it gives me "Unexpected named argument:" error, but on the output window it still say /bin/sh: scriptcs: command not foundGuttersnipe
@Vonc, I don't know why it gives me the scriptcs command not found error as I type scriptcs in the terminal, it doesn't give me that error.Guttersnipe
@Vonc, it is weird, now after I click run it gives me "Unexpected named argument: var/folders/sr/5jzw91rn4g3cc2b0xyhw0j100000gq/T/tempCodeRunnerFile.csharp". Could you let me know how to proceed? ThanksGuttersnipe
@HuibinZhang Then it would be better to explain that issue in a separate question (with a link back to this one)Hunchbacked
@Hunchbacked I have post a separated question #57991318. Thanks.Guttersnipe
B
1

Try "brew install scriptcs" in your terminal.

Bedad answered 12/9, 2023 at 11:24 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.