Why can I not compile TypeScript anymore? - github

I'm doing some web development and I did a commit & sync via GitHub's Mac GUI, then I installed some Mac updates that required a restart (I don't know what the updates were). When I opened my project in PHPStorm again, I found this error when I tried compiling my TypeScript:
/usr/local/bin/tsc
env: node: No such file or directory
I know the compilation was working before. My web application had no issues. This question deals specifically with me being able to do this yesterday, with no changes to the FileWatcher configuration.
I have my TypeScript Compiler in usr/local/bin/tsc (which I have checked as a valid path to a typescript compiler alias). When I click on the alias, It opens a terminal window and runs typescript, so I know it's there. PHPStorm also complains if I try to change the file path, saying I must pick a valid executable.
I modified my Environment Variables on the advice of Dan Clark's site but that hasn't changed anything. I don't have the reputation to upload a photo of my File Watchers Dialog.
Does anyone know why I am getting this error, and how it can be fixed? I mention GitHub because that's the last thing I did before things stopped working: a commit & sync, then a restart to install some Mac updates.
Both which node and which tsc point in the right direction. Just tsc also works.

My solution was to use the directory of the actual TypeScript compiler at /usr/local/lib/node_modules/typescript/bin/tsc
instead of
/usr/local/bin/tsc, which is the alias.
That lets me compile using the FileWatcher.
As for why this happened, it's still a mystery to me.

Related

esp-idf build fails with "fatal error: esp_wifi.h: No such file or directory"

I am a student who has gotten a part time job embedded system programming. I am given a program the company uses, and asked to understand it. This is a working program. Therefore, the project can be built and flashed on ESP32 by the developers with no problem. So, the code and CMake files should have no issues. However, I cannot build the program either with VSCode extension nor with idf.py. In fact, I cannot build esp-idf examples from the official website, either.
Note: I am new to StackOverflow as well as to ESP32, so sorry if I made any mistakes here. If this post is problematic in any way, please inform me.
The error message from the terminal is shown here
I was initially using VSCode on Windows 10 (Windows is not activated). At first, ESP extension was completely failing to start the building process because it could not locate the tools. I was getting "could not be located" errors for all the tools. Below is a list of what I did in this setting:
I had v5.0.0 for esp-idf downloaded from Espressif server. I deleted it and tried v4.3.3 and then I tried to download from Github server. I downloaded the requirements for idf.py scripting environment and completed the settings for it as described by the Espressif's documentation.
I manually set the environment variables for IDF_PATH and PATH for both the user and for the system.
After 2, the initial error was gone. Unfortunately, I had a new error which indicated that ".elf" file for the project output could not be found. I do not exactly recall the error but if it is integral to the problem's solution I can try to replicate this issue.
I tried to delete and reinstall VSCode. I tried running VSCode with admin authority.
I tried changing the IDF_TOOLS_PATH in the VSCode esp-idf extension configurations from ".espressif" to "esp\esp-idf".
At this point, I moved to try to build the project on Ubuntu 22.04.1 LTS:
In Ubuntu, I got the fatal error: esp_event.h: No such file or directory error.
It does not seem to be a common issue and I could not find much about it online.
I followed the Linux setup steps in the documentation. It said that only step 1 (Downloading the prerequisites) was necessary for the VSCode extension.
I decided to try the "master branch" from esp-idf configurations as well. After I downloaded the master branch, the error changed to the current version: 'fatal error: esp_wifi.h: No such file or directory'
I also tried the idf.py in Ubuntu but I got the same error.
Both in Ubuntu and in Windows, the Doctor Command returns nothing. It does not even open the terminal or any window. I am not sure what it should return but some online discussions were asking about its return so I wanted to note it here.
Edit: When I tried the examples on Ubuntu, they actually build just fine. Doctor Command also works with examples.
However, the main code has still issues. Initially, I assumed I made some mistakes with esp-idf configurations. But, perhaps that was not the case.
I had the same problem and ended up editing my project's CMakeLists.txt. When I added "esp_wifi" to the "REQUIRES" list, it worked for me:
idf_component_register(
SRCS "main.c"
INCLUDE_DIRS res
EMBED_FILES res/settings.html
REQUIRES esp_wifi
)

What is the correct way to add an option to the VSCode Settings Menu (editing VSCode's source)

(not sure if I asked this earlier somewhere, but I can't find it)
Earlier I found out how to create a usable entry on the VSCode settings menu (also usable in settings.json) by editing these VSCode source files:
vscode/src/vs/editor/common/config/editorOptions.ts
Adding a variable in export interface IEditorOptions.
Adding an enum in export const enum EditorOption.
Adding an item in export const EditorOptions.
vscode/src/vs/editor/common/standalone/standaloneEnums.ts
Adding an enum to export enum EditorOption.
I don't know if that's the correct way, I just copied other options.
I hadn't yet figured out how to access the new entry's value from the function I wanted to use it in (I had already implemented the functionality, just without the option).
I then got sidetracked and forgot about this.
Now when I try to build it I'm getting an error (it builds fine without the changes).
running yarn --cwd <mydir> run gulp vscode-linux-x64
gives Error: monaco.d.ts is no longer up to date. Please run gulp watch and commit the new file.
I'm not sure exactly how I'm supposed to run gulp watch here. I don't know anything about yarn or gulp (I'm just using the VSCode contributor instructions), and running yarn --cwd <mydir> run gulp watch doesn't fix the problem.
It sounds like vscode/src/vs/monaco.d.ts being read by the build process before being written/updated, because its timestamp changes. I'm not sure if that's my fault and/or if it's a red herring.
Does anyone know what I should be doing here? Has anyone here modified the settings menu?
Is there any documentation out there for modifying the settings menu? (I had a look, didn't find anything).

What are the steps to package and release VS Code?

I am trying to figure out how to package an unchanged fork of VS Code.
My first steps were to follow the electron application distubution documentation, which has not been successful. I also found this post, where another user had the same question. However, the vscode-win32 gulp task seems to have been replaced by x64 and ia32 versions, and when I try running these tasks they generate an out-vscode folder as opposed to a full electron project.
This led me to believe that I can use this new out folder (as well as node modules, packages.json, etc.) with the electron release being used by VS Code to mimic the resources/app folder from the installed version of VS Code in Program Files, however when I try running electron.exe using this method I get:
The factory method of "vs/code/electron-main/main" has thrown an exception TypeError: Path must be a string. Received undefined
In short, I have been struggling with this for a couple of days, and I am out of ideas. If anyone has packaged the project and can offer a suggestion for how to do so, I would really appreciate it.
SOLVED
The issue seemed to be due to being branched off of master as opposed to release. I'd assume there are changes in main that aren't accounted for in the gulp task.
For anyone confused by my post, the expected behavior for a successful build is for a folder named VSCode-win32-x64 to be generated in the directory where your vscode clone is located.

Running MGWT in Super Dev Mode does not pick up code changes

I was evaluating MGWT for the new mobile version of our website. So I downloaded the MGWT's showcase project and set it up in my Eclipse. I was able to compile the project and run it. I was then trying to set up the showcase to run in the Super Dev Mode environment which would help improve the development speed a lot. I followed the steps in Daniel's blog: http://blog.daniel-kurka.de/2012/07/mgwt-super-dev-mode.html.
Everything was fine. I was able to start the Codeserver. I was able to see the Super Dev Mode popup when I opened up the app. I was able to request the Codeserver to recompile and I could see the compilation messages in the console. I could also see the generated JS files of the recompilation.
However, it seemed that the Codeserver did not pick up the changes I made. I tried to change a simple text, then asked the Codeserver to recompile, but the changes did not show after the recompilation. When I checked the new generated JS files, I could see that the Codeserver still used the old code to recompile.
When I restarted the Codeserver, the changes were recompiled correctly and I could see them in the app.
If anyone has a clue of what I might have done wrong, please let me know. I appreciate your help very much.
Thanks
Just happened to find a solution to my own question:
Instead of adding the source folder to the classpath of the Codeserver run config as in Daniel's instructions, I added this source folder as part of the command line arguments using the -src argument (see here for more info).
So the arguments string for the Codeserver launch config should look like:
-bindAddress <codeserver-ip-address> -src <gwt-source-path> <gwt-module-name>

Problems using netbeans 7.01 with CMake 2.8.6

so once again, I'm having a little problem I can't figure out myself. Meaning, I'm pretty sure I know what the problem is, I just can't fix it.
I'm developing in C++ using Netbeans 7.01 with CMake 2.8.6. However, when I'm trying to build a project, I get the following error from CMake:
CMake Error: The path to the source directory:
H:/Projects/Netbeans/CppApplication_1/CONF=Release
contains unsupported character '='.
Please use a different source directory name.
Please note, that "CONF=Release" isn't a folder. It seems to be a configuration flag set by Netbeans, as it changes when I'm trying a debug build. So, my guess here is, that theres a space missing, or something similar. Unfortunately, I can't figure out where to change that. There are no options in any related Netbeans window, I can't find anything related in the configuration files for netbeans itself or the project either.
Did anyone here have experienced the same problem and found a solution to it? I would be very glad to hear it. If there's any information missing, let me know, I will add them as fast as possible.
Edit:
Just noticed there is already version 7.1 of netbeans, nice to know. However, even with this version, the same problem occurs.
You must specify the command you ran to allow for the error to be identified. However, it looks like you missed the "source-path" parameter.
The cmake command ends with the path to source and should be something like:
cmake -D CONF=Release <path to source>