Unable to run a dart program inside VS code - bash

I am new to Dart/flutter. I have installed flutter SDK and VS Code on windows 10 machine, updated the system path, run flutter doctor, which shows that flutter is indeed installed (flutter doctor output). I read that installing flutter is enough, and I don't have to install Dart SDK too, as it comes build in with flutter (please correct me if I am wrong).
I wrote a very short Dart code for testing, but I couldn't run it from VS Code terminal (run in terminal output), as it returns the following error: "bash: dart: command not found".
But when I debug the code in VS Code, it returns the expected output (debug output).
Can someone please explain to me if I am doing something wrong, or if I am missing something? Why can't I run the program from the bash terminal?
Thanks

You should enter the full path directory instead of file name. For doing so right click on the dart file then choose Copy Path.
Then run following code on terminal:
dart (paste main file path)
For more information about creating and running Dart console application using VSCode please check out THIS answer.

Related

ninja: error: loading 'build.ninja': The system cannot find the file specified. when build hello world in Visual studio

I have followed esp-idf guideline to install and test to build the hello world and blink sample code but both the code met this problem.
Visual studio try to build hello world
> Executing task: ninja <
ninja: error: loading 'build.ninja': The system cannot find the file specified.
The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command ninja " terminated with exit code: 1.
I have tested all the ways I can find to fix it but I'm not sure anything I missed or not.
This is one of the way that I test but also met some problem.
cmd try to run the command below
C:\Espressif\frameworks\esp-idf-v4.4>python -m pip install --user -r %IDF_PATH%/requirements.txt
ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.
This possible problem is the python environment is exist so I cannot do this command, but I try many ways to disabled or deactivated it still cannot.
python path
system environment
After trying to debug this for a long time, I made a backup copy of the entire project folder, then just went hog-wild deleting files. I deleted almost every file I didn't author. Only left the main/CMakeLists.txt, main/component.mk, main/main.c, main/main.h, .gitignore, CMakeLists.txt, and Makefile. Then I ran idf.py set-target esp32 and idf.py -p /dev/ttyACM0 flash monitor and it worked fine again.
VS Code & ESP-IDF on Ubuntu 20.04.05 LTS
Check if the compiler is properly selected. If you don't select a proper c/c++ compiler, then you might get this error. I had mingw in my system, but vs code did not auto detect the compiler. Then I manually added mingw and selected it for compilation after which this issue was resolved.
What worked for me after updating to the new stable release (v5.0) was
Go to the folder S:\esp\esp-idf\esp-idf-v5.0
Run command prompt at this directory and execute install.bat and later export.bat
After trying to build the program in VSCode the error "ninja: error: loading 'build.ninja'" shows up.
Update the path in the ESP-IDF extension in VSCode using ESP-IDF:Configure Paths
locate your project folder e.g. "V:\simpleTest_using_EspIDF_v5_0"
Open command prompt and execute: idf.py build
Now it builds also in VSCode using the Espressif IDF extension.
You not have a build.ninja file. Find this file on proje

Getting KeyError: 'WINDOWSSDKDIR' while running Chromium browser source code on Windows

MAIN OBJECTIVE: I'm trying to build and run Chromium browser source code on my Windows. I want to create my own browser. The doc I'm following: https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md
PROBLEM: I'm trying to follow every step and command as mentioned in the doc. I'm having trouble while running this command gn gen out/Default. I'm getting the following error (see the screenshot):
KeyError: 'WINDOWSSDKDIR'
ERROR at //build/config/win/visual_studio_version.gni:27:7: Script returned non-zero exit code.
Here is vs_toolchain.py: https://github.com/arkadee/demo_files/blob/master/vs_toolchain.py
I'm using the latest version of VS Code. I've tried finding the solution myself, but, there are limited resources on the internet about Chromium. Any help will be appreciated, thanks!
Looks like WindowsSdkDir env variable is missing on your computer. You should install Visual Studio (VS Code is different) and the Window SDK, though it doesn't use VC compiler or linker anymore but GN build system needs the path of Windows SDK to copy all the relevant files to the build folder. Go to command prompt and type set, do you see WindowsSdkDir env variable? If not then either the SDK is missing or the env variable has been wiped out

Packaged Electron app (.exe) crashes silently, runs fine via command line

Running my Electron app via command-line works fine, but when I double-click the .exe of the packaged app, nothing happens other than my cursor doing a quick "busy" animation. I assume my app is silently crashing.
Is there a way I can get an error message or a crash report from the .exe to help me see what's going on?
From the root of my app directory, both these methods result in my app running fine:
node_modules\.bin\electron.cmd .
electron-packager .
node_modules\.bin\electron.cmd my_app-win32-x64\resources\app
Environment
OS: Windows 10 Anniversary x64
Node: 4.3.1
Npm: 1.14.12
Local electron: 1.4.3
Local and Global electron-packager: 8.1.0
electron-rebuild (for native module "serialport"): 1.2.1
This was not an Electron problem. This was my app trying to access a path relative to process.cwd(), which, when double-clicking the .exe file in the output folder, was not the expected one.
I was able to debug this by running the .exe from the command line, instead of double-clicking the .exe:
my_app-win32-x64\my_app.exe
This causes console.log() output to be visible in the command prompt, which allowed me to finally see the exception that was occurring.
One way to debug such issues is to open a terminal or cmd and drag the exe to it or launch the exe from the terminal or cmd. this will print any uncaught error the app might be throwing.
This can be an issue with paths if you're spawning sub processes - you can use https://github.com/jonluca/node-fix-path to fix the paths on linux and macos

Error: "Could not find build tools necessary to build stringi" when trying devtools::install_github()

Trying
devtools::install_github("Rexamine/stringi")
and getting error:
Could not find build tools necessary to build stringi
I see several people have had this error but the solutions haven't worked for me. I reinstalled xcode because the command line tools seemed to be the problem for other people. Checked the paths for R and RStudio, I can open both fine (from the terminal as well). Don't think this is an Rtools issue but I can't figure out where the problem is. Has anyone had any luck with this particular devtools error?
Running OSX 10.11.6, RStudio Version 0.99.896, R 3.2.1 GUI 1.66 Mavericks build (6956), XCode Version 7.3.1 (7D1014).
You can try running
/usr/bin/clang --version
If command line tools are installed, this should just report the version of clang installed; otherwise, you'll be prompted to install Xcode + Command Line Tools. (This is just a simple way of ensuring command line tools indeed are installed)
If you run
devtools::install_github("Rexamine/stringi")
in a plain R console, outside of RStudio, what do you see? Can you update your post with the errors (if any) printed to the console?
You might also try updating RStudio to the preview release (https://www.rstudio.com/products/rstudio/download/preview/) to see if that helps.
It seems like this is likely a bug in RStudio's build tools detection; you might try explicitly disabling it with:
options(buildtools.check = function(action) TRUE)
This should ensure that devtools doesn't try to call RStudio's build tools detection code and just assume that everything is available.

How to run MonoDevelop's nunit-console on OSX?

The MonoDevelop I'm using came with Unity3D. I can see nunit-console inside its package contents at MonoDevelop/Contents/Frameworks/Mono.framework/Versions/2.10.2/bin/nunit-console, but what I can't figure out is how to call it from inside Terminal.
Here the guy mentions adding a path to MONO_PATH, but I don't know how to address a path inside a package and when I type env, I do not see a MONO_PATH at all. Also mono is not recognised as a command in Terminal, so the advice here doesn't really help me either.
It's got to be a simple configuration issue, but I'm new to developing in OSX.
Try this:
Write the following command on Terminal
mono {path to nunit-console.exe}
For example: "mono Downloads/NUnit-2.6.4/bin/nunit-console.exe"
nunit-console is just a shell script that calls nunit-console.exe .NET Assembly using the full path to mono, so try to open the file in a text editor and see if you can see where it thinks that mono should be.
What error do you get if you try to execute:
MonoDevelop/Contents/Frameworks/Mono.framework/Versions/2.10.2/bin/nunit-console
from Terminal?

Resources