Yeoman. The filename, directory name, or volume label syntax is incorrect - yeoman

Reinstalled Windows 10 (Version 10.0.14393). Reinstalled the following:
Java
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
nodejs (v6.9.5)
NPM (3.10.10)
Yarn (v0.19.1)
Yeoman (installed with yarn global add yo)
When I write yo -v in cmd in any folder, runned with administrator or not, I take:
The filename, directory name, or volume label syntax is incorrect.
UPDATE:
The only workaround I found is to use the full path of yo:
C:\Users\<username>\AppData\Local\Yarn\config\global\node_modules\.bin\yo.cmd

It may be that your PATH does not point to global NPM modules yet. The FAQ and links are more helpful for gnu/linux or mac users. The PATH is a list of the places that your operating system checks whenever you type a command.
Since you are using Windows, to add the modules path temporarily (just for one session) at the prompt, just type (obviously use the correct path with your correct username and please take note of the ; separator character):
path = %path%;C:\Users\<username>\AppData\Local\Yarn\config\global\node_modules\.bin\
You should then be able to run 'yo -v' without pointing to the full path name, since the console now knows to check that folder also. If that works for you, you can add that path permanently using the instructions described on another SO post here.
Finally (and this is only slightly related to your question), since i notice you've got the Windows 10 anniversary update, if you have Linux experience, you may prefer to use "Windows subsystem for Linux", which is a bash shell (Ubuntu 14) on Windows, that you can use instead of the default command prompt. You can find it under "Add / Remove programs --> Turn Windows features on or off --> (scroll right down) --> Windows subsystem for Linux (beta)". Your local file system will be at "/mnt/c" so you can get to it from within the shell or from windows explorer. I've had fewer problems using this and since so many tutorials are written with bash (not command prompt) in mind, it's useful to use it instead of cmd.
You'll need to install dependencies in the usual way using apt-get (as it won't use the ones you've installed on the windows side) and you'll need to prefix commands that make system changes with 'sudo'. e.g.
sudo npm -g modulename

Related

Why is my WSL2 enviornment referencing Java folder outside its virtual environment?

When I start my development rails server I get this following message first. To my knowledge WSL2 is a virtual environment.
I would have expected it to now reference a Java directory that resides on my Windows host. Is this likely something I carried over in the project from when I was using WSL1? How would I safely correct this?
/home/daveomcd/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/railties-6.0.3.2/lib/rails/app_loader.rb:53:
warning: Insecure world writable dir /mnt/c/Program Files (x86)/Common Files/Oracle/Java/javapath
in PATH, mode 040777
I experienced the same problem when trying to fix the slowness of WSL2. The recommended solution was to move the files from the mounted NTFS drive to the root ext4 filesystem (using \\$wsl\<distroname>), so I did that.
I set up /etc/wsl.conf as below:
# Enable extra metadata options by default
[automount]
enabled = true
root = /mnt/
options = "metadata,umask=0033"
mountFsTab = false
[interop]
enabled = true
appendWindowsPath = true
And ran rails bundle to update dependencies.
Also make sure that your file permissions and owner settings are updated. Hope it helps.
Sorry, I'd love to make this more of a comment to see if I'm on the right track before committing to an answer. However, since there's too much info here for that, I'll make an attempt at getting you an answer here.
While it is a virtual environment, by default WSL provides several "Windows Interop" features that allow it to:
automatically mount Windows drives in /mnt/{c,d,...}
append the Windows path to the Linux path
run Windows executables inside Linux
share Windows environment variables with Linux (although this is not something that happens by default)
I can't be sure (long, long time since I've used Rails), but it looks like something in the app_loader.rb is checking permissions on Java directories in the path. It may be using some logic like "check each path entry and look for a java or java.exe there. If found, check permissions." Or something like that. That means that (2) and (3) above may be confusing it.
You can see this in action with which java.exe, which will likely return a Windows path. Or run notepad.exe, which will launch the Windows Notepad executable from within Linux/WSL (magic! 😉).
These are both very useful features, so I hate to disable them completely, but it's the easiest way to figure out if that's the problem. Create a /etc/wsl.conf with the following contents:
[interop]
enabled=false
appendWindowsPath=false
Exit your WSL instance and then:
(from PowerShell, CMD, or Windows Start) Run wsl --list --verbose to see the name of your distribution (most likely Ubuntu)
Likewise, run wsl --terminate <distro> to terminate that distribution.
Restart your WSL instance
Try running /mnt/c/Windows/system32/notepad.exe (assuming a normal C:\Windows installation) (should fail, since interop is disabled)
Try which notepad.exe (should fail, since the Windows path should no longer be appended to the Linux path)
Try to start your Rails dev server again - Might work (might not, I could easily be wrong about the root-cause here)
If it does work, then you can try to correct the situation with several less invasive methods than disabling those features entirely:
If you plan on only using WSL for your development, then you could remove the Windows JDK.
Or at least remove the Windows JDK from the PATH in Windows.
Or, if you want to keep it installed and in the Windows path, you could have a shell startup file (e.g. .bashrc) that removes it from the path only in WSL. I'll point you to this question which contains multiple techniques for doing so.
Or you could keep the appendWindowsPath=false in your /etc/wsl.conf but then add back in the paths you want manually in your startup config.

Get Microsoft Edge Browser Version using registry or command line

How can i get microsoft edge browser version using registry or command line?
I don't want to take it from UI.
For Microsoft Edge Legacy, you can get the version from PowerShell with Get-AppxPackage:
> (Get-AppxPackage Microsoft.MicrosoftEdge).Version
44.18214.1000.0
If you want to call this from cmd.exe, you can just call Powershell:
> powershell.exe "(Get-AppxPackage Microsoft.MicrosoftEdge).Version"
44.18214.1000.0
In Windows
The first of all, you need to get the path of the .exe file of the application.
use Get-Item
It is just like Get-AppxPackage. And get the version by adding .VersionInfo.
> (Get-Item "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe").VersionInfo
ProductVersion FileVersion FileName
-------------- ----------- --------
85.0.564.63 85.0.564.63 C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe
use wmic
wmic can get the information of the application. And we set the name key for which application you want to check.
> wmic datafile where 'name="C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe"'
AccessMask Archive Caption Compressed CompressionMethod CreationClassName CreationDate CSCreationClassName CSName Description Drive EightDotThreeFileName Encrypted EncryptionMethod Extension FileName FileSize FileType FSCreationClassName FSName Hidden InstallDate InUseCount LastAccessed LastModified Manufacturer Name Path Readable Status System Version Writeable
1179817 TRUE C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe FALSE CIM_LogicalFile 20200924185451.733609+480 Win32_ComputerSystem DESKTOP-QCUDFJL C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe c: c:\program files (x86)\microsoft\edge\application\msedge.exe FALSE exe msedge 2882448 Application Win32_FileSystem NTFS FALSE 20200924185451.733609+480 20200928200140.091076+480 20200923164851.469016+480 Microsoft Corporation C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe \program files (x86)\microsoft\edge\application\ TRUE OK FALSE 85.0.564.63 TRUE
And then, filter the result by adding get {key} at the end of command.
> wmic datafile where 'name="C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe"' get version
Version
85.0.564.63
In MacOS
use --version
The application is executed from /Applications/"Microsoft Edge.app"/Contents/MacOS/"Microsoft Edge. Therefor, we can command like the bottom.
$ /Applications/"Microsoft Edge.app"/Contents/MacOS/"Microsoft Edge" --version
Microsoft Edge 85.0.564.63
The older answers to this question seem to address Edge Legacy to the exclusion of Edge Chromium (which is now standard). Adding this answer to more fully outline current options targeting Edge Chromium, specifically.
Windows via Registry
For Windows systems, reading the Edge version from the registry is probably your best bet, since it's consistent even when the installation path varies. Some command-line for reading the installed version of Edge Chromium from the registry. There are a few options for that.
Using Powershell:
(Get-ItemProperty -Path HKCU:\Software\Microsoft\Edge\BLBeacon -Name version).version
Using Powershell and Windows Script Host:
(New-Object -ComObject WScript.Shell).RegRead("HKCU\Software\Microsoft\Edge\BLBeacon\version")
Using Reg Query:
reg query HKCU\Software\Microsoft\Edge\BLBeacon /v version
Windows via Executable
If you have more than one instance of Edge installed (for example, an Edge Dev Channel build) and you want to get the version of a specific installation, you can access the VersionInfo metadata of the Edge executable.
Using Powershell:
(Get-Item "C:\Program Files (x86)\Microsoft\Edge Dev\Application\msedge.exe").VersionInfo.FileVersion
Using the WMIC tool:
(Note that escaping is required when translating the EXE path into the WMI query)
wmic datafile where 'name="C:\\Program Files (x86)\\Microsoft\\Edge Dev\\Application\\msedge.exe"' get Version
Non-Windows via App Binary
For non-Windows installations, running the binary from your shell with the --version flag seems to be the best bet. Your path may vary.
Ubuntu example:
/usr/bin/microsoft-edge --version
Mac OSX example:
/Applications/Microsoft\ Edge.app/Contents/MacOS/Microsoft\ Edge --version
Via Package Managers:
Especially on Linux installations, where Edge is likely to have been installed using a standard package manager, version querying via package management is also a solid option.
Note that this option does only apply if the Edge installation is under package management, which is pretty uncommon in non-Linux userland.
Using apt (Ubuntu):
apt list microsoft-edge
Using Homebrew (Mac OSX):
brew info microsoft-edge
Using Chocolatey (Windows):
choco list -l microsoft-edge
Run the following command:
REG QUERY HKEY_CLASSES_root\AppX3xxs313wwkfjhythsb8q46xdsq8d2cvv\Application /v ApplicationName
Example output:
HKEY_CLASSES_ROOT\AppX3xxs313wwkfjhythsb8q46xdsq8d2cvv\Application
ApplicationName REG_SZ #{Microsoft.MicrosoftEdge_40.15063.674.0_neutral__8wekyb3d8bbwe?ms-resource://Microsoft
.MicrosoftEdge/Resources/AppName}
Now you just need to extract the version, e.g. the 40.15063.674.0.

App running on Windows 10 machine can't find file

I had an app using chromedriver on a Linux machine, and I switched the app over to a Windows 10 machine. Now suddenly it's telling me that it can't find the chromedriver file.
Here's error:
Selenium::WebDriver::Error::WebDriverError in Static#home
Showing C:/Users/User/Documents/test_app/app/views/static/home.html.erb where line #4 raised:
Unable to find chromedriver. Please download the server from http://chromedriver.storage.googleapis.com/index.html and place it somewhere on your PATH. More info at https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver.
I placed the chromedriver file in the same place it was on my Linux machine, right in the main folder of the app. In this case the path is C:\Users\User\Document\test_app. Does Windows interpret paths differently than Linux?
The chromedriver is the latest release. It's titled "chromedriver_win32.zip". The "win" means Windows. Could the "32" mean it's for a 32-bit system? My machine is 64-bit.
If you put the chromedriver.exe in the folder Chromedriver_win32.zip which is in the same folder as your script, you can set the driver_path to that file. See code below:
require "selenium-webdriver"
Selenium::WebDriver::Chrome.driver_path = File.join(File.absolute_path('./', "Chromedriver_win32.zip/chromedriver.exe"))
driver = Selenium::WebDriver.for :chrome
driver.get "https://www.google.com.sg/"
I don't have any knowledge on ruby or ruby-on-rails. please find the equivalent in java or python in Windows OS.
Two ways:
you can keep Chrome driver in a place where it is added to PATH variable (environment variables in Windows 10)
Programmatically set the path to the executable chromedriver.exe
For Java:
System.setProperty("webdriver.chrome.driver", "/path/to/chromedriver");
For Python : (we keep chromedriver.exe in C:\Python27\Scripts location. this location is already added to PATH variable when python (Activestate) is installed. in case, chromedriver.exe is not in one of the PATH locations, you can specify as follows)
driver = webdriver.Chrome('/path/to/chromedriver') # Optional argument, if not specified will search path.
For Ruby:
Add the ruby installation path to Windows PATH environment variable and keep chromedriver.exe in that location. (Windows searches for binaries in the locations specified in PATH variable.)
For more info on setting ruby installation location to PATH
https://stackoverflow.com/a/26947536
References:
https://sites.google.com/a/chromium.org/chromedriver/getting-started
I would put this in as a comment, but, since I'm relatively new, I am forced to put it in as an answer, which it might well be...
Pardon me if I'm asking the obvious, but, did you try "unzipping" the file and putting the ".exe" file into that directory? The file you mentioned (you said.. titled "chromedriver_win32.zip") is not an executable file in Windows. The file you should be looking for is chromedriver.exe.

How to change the version of python that pyscripter uses

I am a newb with python and just learning what to do.
I am using pyscripter and have been for a while whilst learning.
I am now going through an online course which is taught in 2.6, yet my pyscripter uses the latest.
I need to know how to change it to use an older version, I have seen replies about changing the PATH variable but not where it is or how to do it.
I have 3 versions of python on my machine, 25,26 and 33.
I don't know if this is the best way to do it, but those are the two ways I did it:
WAY 1 (The best of two)
Go to PyScripter>>Tools>>Options...>>Custom Parameters... and add the following values
1. PythonDir = C:\Program Files\CustomPythonInstallation
2. PythonExe = C:\Program Files\CustomPythonInstallation\python.exe
3. PythonVer = 3.3.3
Note: Adapt the Name = Value pairs above to your case.
And close the window with OK button.
Now select PyScripter>>Run>>Python Engine>>Remote and your are ready to go.
WAY 2 (The more temporary solution)
Go to PyScripter>>Run>>Configure External Run...
set the "Application:" field to your python.exe file
Close the window with OK button.
Make sure you run your scripts with PyScripter>>Run>>External Run (Alt+F9)
I hope this helped, good luck.
The easiest way I know (on Windows) is, having used the installer executable, I select from the Start menu's PyScripter folder whichever version of Python I want to run.
You can modify the PYTHONPATH (under Pyscripter>>Tools, for instance)
You can modify your External Python Interpreter with Pyscripter>>Modify Tools>>Python &Interpreter>>Modify
You can modify the default Python engine used with Pyscripter>>Options>>IDE Options>>Python Interpreter>>Python Engine Type
You can simply redirect Pyscripter to see the environment of a different Python distribution.
In Windows, do this by assigning PYTHONDLLPATH in the Pyscripter shortcut. You can r-click on the shortcut, access its properties and then set the target to:
[Pyscripter executable dir] --PYTHONDLLPATH [Python distribution dir]
See this image to help you out:
setting a shortcut target
For example, in my Win10 64-bit computer I have a Python 2.7.8 installation back from when I installed ArcGIS, which is automatically recognized by my 32-bit Pyscripter installation.
In the same computer, I also have Anaconda installed with two environments that feature two 64-bit Python distributions:
2.7.14 in "C:\ProgramData\Anaconda2"
3.6 in "C:\Users\bouzi\AppData\Local\conda\conda\envs\py3"
When I installed a 64-bit version of Pyscripter, that Pyscripter version couldn't even open, as it couldn't find the conda distributions. I had to point them to it by replacing the shortcut target to:
"C:\Program Files\PyScripterx64\PyScripter.exe" --PYTHONDLLPATH "C:\ProgramData\Anaconda2"
You can create three Pyscripter shortcuts that point to these different installations of Python within your system. It's probably not the optimal way to deal with this but it works, and allows you to combine Anaconda environments with Pyscripter.
You can also read more on opening non-standard python distributions with PyScripter from this link.
Run->Python Versions -> setup Python Versions -> Add... select folder
p.s.
python 3.7.3 - ok,
still python 3.10.5 could not be identified by PyScripter in such a way (actually works with WAY_1 Solution in this thread but pip install under such env. not succeed afterwards)

Windows x64 RabbitMQ install error with Erlang environment var (ERLANG_HOME)

I'm ask/answering this question because it hung me up & it's likely someone else will have the same problem.
Install of RabbitMQ x64 v2.8.6 on Windows Server 2008 x64.
After Erlang install using default install location to C:\Program Files\erl5.9.2, I'm attempting to start the server via running the rabbitmq-service.bat. Fail:
Please either set ERLANG_HOME to point to your Erlang installation
or place the RabbitMQ server distribution in the Erlang lib folder.
Problem is the .bat file does not have the correct subpath. with 5.9.2 (R15B02) version of erlang. My ERLANG_HOME directory is set correctly, but the script does not use it correctly for this version of Erlang, which, it appears to this Erlang noob to have a new subdirectory called "erts-5.9.2" which is causing the problems. Maybe someone intimate with these scripts can describe how to make this work correctly without the hack workaround I'm about to describe?
1- Set environment variable:
Variable name : ERLANG_HOME
Variable value: C:\Program Files (x86)\erl6.4
note: don't include bin on above step.
2- Add %ERLANG_HOME%\bin to the PATH environmental variable:
Variable name : PATH
Variable value: %ERLANG_HOME%\bin
This works well.
There are several RabbitMQ control .bat files on windows. Every one you use needs to get changed to reflect the Erlang path correctly. In this example, I'm editing the rabbitmq-server.bat because it's one of the easier ones... any of the .bat files you want to run will need this hack to get them to work, with the rabbitmq_service.bat file being the most involved to adjust.
editing that rabbitmq_server.bat file, you can see on about line 48 or so there's a check to see if the erl.exe is found, but the path isn't correct:
if not exist "!ERLANG_HOME!\bin\erl.exe" (
that path does not match the file structure for the 5.9.2 version of Erlang. I fixed this by simply removing this path check from about line 48 to 58, then, where the .bat actually makes a call to the erl.exe on about line 129 which reads:
"!ERLANG_HOME!\bin\erl.exe"
I simply hardcoded the path to my erl.exe:
"C:\Program Files\erl5.9.2\erts-5.9.2\bin\erl.exe"
With the pathing correct, the rabbitmq .bat files will run.
I had the similar issue, modifying ERLANG_HOME in .bat files did not work. Then I tried echo %ERLANG_HOME% in command prompt, that did not print the environment variable value(I could see that ERLANG_HOME environment variable has been created under advance system settings), that lead me to believe that I need to restart server for 64 bit installation of Erlang. After rebooting server, It worked like a charm. I hope this helps someone.
Just to share an up-to-date answer as of 2019: On Windows Server 2019, after setting up the environment variable, a restart is required to solve the problem.
I got into same kind of problem.
I solved it by doing three changes as given below.
Update Path variable "ERLANG_HOME" : "C:\Program Files\erl8.0" in Environment Variables.
Upadte "Path" variable "Path" : ";%ERLANG_HOME%\bin;"
Give urself FULL CONTROL permissions over "Program Files" in C drive.
It worked for me in this way.
This problem still occurs in Erlang 18.3 (erl7.3) and RabbitMQ 3.6.9 on Windows when upgrading from any older version of RabbitMQ to version 3.6.9. The solution as already stated here is to manually set ERLANG_HOME with 'setx -m ERLANG_HOME "C:\Program Files\erl7.3"' before starting the service.
What happens is that the RabbitMQ 3.6.9 installer removes the environment variable ERLANG_HOME from the system while removing the older version of RabbitMQ. Then, when it proceeds to the installation step, it does not put back the ERLANG_HOME variable. Then, the batch files that start up RabbitMQ cannot find Erlang. They try to find Erlang's home directory using "where.exe" but it always fails after an upgrade.
RabbitMQ's installer also does not kill all of the Erlang background processes, causing many of its files to be undeletable due to the Windows "file in use" problem. This leaves behind "files in use" in %APPDATA%\RabbitMQ and "C:\Program Files\RabbitMQ." These processes are "erl.exe," "erlsrv.exe," and "epmd.exe." The RabbitMQ installer should taskkill these processes after shutting down the RabbitMQ Windows service.
RabbitMQ is rather clunky on Windows.
Download Erlang or OTP - Only one Version of OTP should be installed
Download RabbitMQ installer
Install both exe file as Administrator
Set class path for Erlang. (Setting classpath is a bit troublesome, so follow these steps)
Set a new path with name ERLANG_HOME and value C:\Program Files\erl-23.1 (do not copy bin folder here)
Edit System "path" and add %ERLANG_HOME%\bin
Go to Start - Open rabbitmq command promt and run
rabbitmq-plugins enable rabbitmq_management
Navigate to localhost:15672
Use guest/guest to login
Interesting that this worked for you. There is record of a two bugs in Erl5.9.2 that cause an incomplete installation where %ERLANG_HOME%\bin is not installed.
Either of
* Installed 64bit erlang on 32bit machine
* "The program can't start because MSVCR100.dll is missing from your computer."
https://groups.google.com/d/topic/erlang-programming/wGtFLzapiQ0/discussion
Try 5.9.1 or any other version. They also mention making the future versions of the installer alert you if it fails.
I just had the same problem mentioned here. I installed otp_win64_R15B02 on a Windows 7 machine and everything worked perfectly, but I used the same installer on a Windows 2008 server and the bin directory was not created. I then uninstalled otp_win64_R15B02 and downloaded the otp_win64_R15B02_with_MSVCR100_installer_fix and the bin directory was created.
I suspect the reason it worked on my Windows 7 system is that I have Visual Studio installed and the required libraries were already available which allowed the otp_win64_R15B02 installer to work correctly.
Oh, and if you're installing Erlang to run RabbitMQ the RabbitMQ install will succeed with the broken installer but installing otp_win64_R15B02_with_MSVCR100_installer_fix after RabbitMQ will not work, just un-install and re-install RabbitMQ to resolve this.
Just give C:\Program Files\erl10.6\ not C:\Program Files\erl10.6\bin\erl.exe in the environment variable. If you open the server.bat file I came to know the issueenter image description here
I think this is encoding issue on windows.I see a correct value but I write echo %ERLANG_HOME% on console the value come with question mark. These steps fix it.
1.go environment variable window
2.edit ERLANG_HOME item
3.copy the value, open notepad and paste there
4.copy again on notepad and paste to edit window
5.apply and exit window
6.close command line tools and reopen
7.run rabbitmq bat file.
I solved it in a quick and dirty way,without naming path variables
I've opened the bat file and replaced every occurrence of
!ERLANG_HOME!\bin\erl.exe
with hard coded path for example might be diffrent path for you because of diffrent version
C:\Program Files\erl10.3\erts-10.3\bin\erl.exe
and replaced
%RABBITMQ_HOME%\escript\rabbitmq-plugins
with
C:\Program Files\RabbitMQ Server\rabbitmq_server-3.7.14\escript\rabbitmq-plugins
Even I was this problem. The issue was the environment variable ERLANG_HOME=c:\Program Files\erl9.0 which was never existed.
I cross checked the path. The correct path was c:\Program Files\erl9.3.
After correcting the
ERLANG_HOME=c:\Program Files\erl9.3
the problem solved. So, definitely it is a path issue.
In my case, it should be installed erlang using admin role running
If above solutions doesn't work for you then you can try following
Find another compatible version of erlang for your rabbit mq e.g. for rabbit 3.7.x erlang version 20.3.x to 22.0.x all are compatible .
Right click newly downloaded erlang version and from properties select the option to unblock the file .
Run the erlang with admin persssion .
Re run rabbit mq exe

Resources