Installing JSHint on VS Code - jshint

I tried to install JSHint through command, but I'm getting this error:
C:\Users\user>npm install -g jshint 'npm' is not recognized as an internal or external command, operable program or batch file.

If you installed node try the below. Otherwise first install node.
Open the Control Panel (Click the Start button, then click Control Panel)
Click User Accounts
Click Change my environment variables
Select PATH and click the Edit... button
At the end of the Variable value, add ;C:\Program Files\nodejs
Click Ok on the "Edit User Variable" window, then click Ok on the "Environment Variables" window
Start a command prompt window (Start button, then type cmd into the search and hit enter)
At the prompt (C:>) type npm and hit enter; you should now see some help text (Usage: npm  etc.) rather than "npm is not recognized..."

Related

Hide Console from Executing CMD /c <executable> On Registry for Context Menu

I have an executable to work on some data files. On Windows 10, because of the alias path of the executable, I need to put "CMD /c <executable_path>" on the registry to run the executable from the context menu (ref: Can't run an EXE from context menu when using ALIAS path in windows registry). However, this would show the console window until the executable finishes. Is there any way to hide the console window during the execution?
I have tried to add "START /b" or "START /min" to the command on the registry, but with those the Windows would pop up a dialog asking me what to do with the selected file.

How to fix zsh: corrupt history file /home/mis/.zsh_history (Linux)

Whenever I open terminal I got his Warning!
[WARNING]: Console output during zsh initialization detected
When using Powerlevel10k with instant prompt, console output during zsh
initialization may indicate issues.
You can:
Recommended: Change ~/.zshrc so that it does not perform console I/O
after the instant prompt preamble. See the link below for details.
You will not see this error message again.
Zsh will start quickly and prompt will update smoothly.
Suppress this warning either by running p10k configure or by manually
defining the following parameter:
typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet
You will not see this error message again.
Zsh will start quickly but prompt will jump down after initialization.
Disable instant prompt either by running p10k configure or by manually
defining the following parameter:
typeset -g POWERLEVEL9K_INSTANT_PROMPT=off
* You will not see this error message again.
* Zsh will start slowly.
Do nothing.
You will see this error message every time you start zsh.
Zsh will start quickly but prompt will jump down after initialization.
console output produced during zsh initialization follows
zsh: corrupt history file /home/mis/.zsh_history
You can solve it by removing the package (purge) and reinstall it back.

'flutterfire configure' command not working, I need to set firebase in my flutter project

I followed "https://firebase.flutter.dev/docs/overview" instruction to set firebase in my flutter project.
step i took:
"flutter pub add firebase_core" then dependencies were added, and generated_plugin_registrant.dart was created.
generated_plugin_registrant.dart file
2) "dart pub global activate flutterfire_cli" it showed an warnign message ie "Warning: Pub installs executables into C:\Users\Asus\AppData\Local\Pub\Cache\bin, which is not on your path.
You can fix that by adding that directory to your system's "Path" environment variable.
A web search for "configure windows path" will show you how.
Activated flutterfire_cli 0.1.1+2."
then i added "C:\Users\Asus\AppData\Local\Pub\Cache\bin" in system; "path" environment variable.
"flutterfire configure" now it gives error "bash: flutterfire: command not found".
Step by step commands for getting flutterfire work in Mac:
dart pub global activate flutterfire_cli
export PATH="$PATH":"$HOME/.pub-cache/bin"
curl -sL https://firebase.tools | bash
firebase login
flutterfire configure
More details here
Windows Step-by-Step guide:
Open the Windows Search Bar, type in “env”, and choose “Edit the system environment variables”
Click the “Environment Variables…”
In System Variables box, search for "PATH" and double click on it
Click "New" and then paste the following line, replacing *USERNAME* with your Windows username
C:\Users\*USERNAME*\AppData\Local\Pub\Cache\bin
Click Ok and restart your IDE, then try flutterfire commands
I had the same problem. Following command worked for me (in Windows).
flutterfire.bat configure
I had same problem and I solved this by:
Added C:\Users\<username>\AppData\Local\Pub\Cache\bin to Environment Path.
Restarted IDE
Executed command: dart pub global activate flutterfire_cli
Here's a solution that worked for me:
From your terminal,open your bash profile in your home directory. Example home directory, Users/your-name/. I'm using macOS, so I typed typed the command sudo vim ~/.bash_profile from my home directory folder, followed by E to edit.
Scroll to the bottom of the file or below # Flutter ENV, on your keyboard, hit i to insert, then paste the following line, export PATH="$PATH":"$HOME/.pub-cache/bin". Press ESC, type ":wq!" then press Enter to save the changes and exit vim.
From the command line, reload your bash profile with source ~/.bash_profile. flutterfire configure should now work.
Hrishabh
This worked for me.
Close your IDE.
Restart IDE.
Re-run "flutter pub add firebase_core" in your terminal.
Finally run "dart pub global acttivate flutterfire_cli" in your terminal.
I had the same problem here is the way to solve it:
Warning: Pub installs executables into C:\Users\userName\AppData\Local\Pub\Cache\bin, which is not on your path.
You can fix that by adding that directory to your system's "Path" environment variable.
Go the Windows searchbar and write var
Select modify system environment
Click on environment variables
On system variables click on Path
Click on Edit
On the modify the environment variable windows click on New
Copy paste C:\Users\userName\AppData\Local\Pub\Cache\bin
Close all the windows clicking on Ok
Restart Android Studio
Inside Android Studio terminal write this to check if succeed
dart pub global activate flutterfire_cli
You should have the following message:
The package flutterfire_cli is already activated at newest available version.
On windows, from flutter root folder, running 'flutterfire configure' I got the same error message.
The 'problem' was resolved when I removed the following lines from pubspec.yaml.
plugin:
platforms:
ios:
pluginClass: AppDelegate
(I added those lines in an attempt to create a "podfile" that is required in order to create a binary ios file. )
For me it required a little bit more work but this is what worked for me, I'm using Windows:
As mentioned already before I ran these steps:
1). Search for "Edit System Environment Variables"
2). Click on Environment Variables
3). Under System Variables, double click on "path."
4). Click on "New" and add C:\Users\USERNAME\AppData\Local\Pub\Cache\bin
5). Click OK and restart IDE
After restarting IDE I ran the following commands in the terminal and this time it worked
1). Firstly, flutter upgrade firebase_core
2). Then, I ran dart pub global activate flutterfire_cli again and this time when I ran flutterfire commands it worked.
For me it wasn't working in bash. When i switched over to the standard windows comand prompt it worked.

How to run orca from R?

I have installed orca using npm and if I go to my R project folder and type orca --version, I see 1.3.1.
In Rstudio I have installed the processx package. Having produced a fig with plot_ly if I try capture a plot I see the following
orca(fig, 'temp.svg')
Error in processx::run("orca", "-h") :
System command 'orca' failed, exit status: 127, stderr:
E> env: node: No such file or directory
Type .Last.error.trace to see where the error occurred
If I type .Last.error.trace I see the following
Stack trace:
1. plotly:::orca(fig, "temp.svg")
2. plotly:::orca_available()
3. plotly:::correct_orca()
4. processx::run("orca", "-h")
5. throw(new_process_error(res, call = sys.call(), echo = echo, ...
x System command 'orca' failed, exit status: 127, stderr:
E> env: node: No such file or directory
I have restarted Rstudio and restarted R, but still see the problem. How do I fix this?
From your description, I assume that you already installed both orca and processx library. The next steps are:
install standalone Orca desktop app and
Makes the path of the installation accessible from Rstudio
You may skip the step one and directly go to the second step since you mentioned that you already installed the desktop app using NPM. However, I recommend you to reinstall it as I did.
For doing step one with regular installation method, you can download Orca installer (windows-release.zip) from github: orca installer. Then, install the app inside the zip folder.
After installing it, you can go to the second step by doing:
Find your Orca app displayed on your desktop, right-click on the orca icon and select Properties from the context menu.
From the Shortcut tab, copy the directory in the Start in field.
(you need this for adding the app's PATH later in step-7).
hit "windows logo + X" to open Power-User menu, go to SETTING
go to ABOUT, click the Advanced system settings
click the Advanced tab, then click the Environment Variables button near the bottom of that tab
highlight the Path variable in the SYSTEM VARIABLES section and click the Edit button
Add path lines by paste your installation path (from step-2)
Restart your PC to ensure everything runs smoothly.
Finally, you can try your code again in Rstudio. Hope this can help some confusions.

When running script: "julia -i run/run_nf.jl", the error following error is displayed "Could not determine command"

When I input the command
"julia -i run/run_nf.jl" the error "could not determine command" is shown.
before the error is shown this is how my cd looks like:
After activating the project with the command "activate." The following text is displayed in purple color ""
Finally with the command "julia -i run/run_nf.jl" I run the script "run_nf.jl" that is located on the folder "run". However, instead of running the script the following error is displayed.
The instruction for running and installing the necessary pachages are described in detail here:
Instruction, which I am based to run my script
As #fredrikekre mentioned in the comments, you are trying to run a terminal command from the Julia REPL's PKG mode, which will not work. You have two options:
Run the command from inside the REPL's shell mode by first using the "delete" or "backspace" key to exit out of the Pkg mode (you will see the prompt change) and then typing in ; which switched the REPL to shell mode and then you can run that command.
Same as above in that you need to exit the Pkg mode by clicking the "delete" or "backspace" key on you computer, and then you can run (from the REPL) include("run/run_nf.jl") which will run the file (assuming that is the correct file path).
I will also make a PR to that package you linked above to update the docs to be more clear. Edit, link to PR: https://github.com/dynamicslab/NormalFormAE/pull/7

Resources