Vue-cli: arrow key not working while creating new project on git bash windows - vue.js

I am trying to create a project which Vue-cli through Git bash Window.
Git version 2.14.1.windows.1
Vue version 3.0.0-rc.3
For some reason the cursor is still visible during installation.
And when I press any arrow key, the option does not change, only the cursor move around. (However, pressing enter still process me to the next step).
Searching for a solution with google does not let me anywhere, only a few Github bug report: https://github.com/vuejs/vue-devtools/issues/283

I had the same issue. The solution I came up with was:
$ winpty vue.cmd create `<project-name>`

Surprisingly, Windows Command Prompt is not suffered from this bug. So my solution is:
Hold Shift + Right click project folder -> choose Open command window here
This does not solve the root cause. If you happen to know a better option, please post your answer.
Note:
If you get error cannot execute scripts on powershell, then you need to enable script execution. Run powershell as administrator and run the following command to enable scripts on it:
Set-ExecutionPolicy -ExecutionPolicy Unrestricted

UPDATED 2021, Apr 4th!
Here's a CTRL+C and CTRL+V step-by-step practical solution to solve this. The fact that you have this trouble means you are on Windows and you most likely use Git Bash.
Using Git Bash a quick solution would be typing
echo 'alias vue="winpty vue.cmd"' >> ~/.bashrc
This will not overwrite .bashrc, and instead append the text on the left of >>
Restart your bash. That means close it and open it again.
If you're looking for "Why do I have to add such thing to .bashrc?", I think another user has mentioned that. If you found this helpful please upvote it so others can see it too.
Old answer
You can try to make a file .bashrc in your current <UserNameProfile>.
Then, inside of it use your favourite text editor and write
alias vue='winpty vue.cmd'
Then restart your bash. And you should be able to use vue as it should be on the documentation.

There are two ways to solve this issue which is explained in the Vue CLI Documentation:
1 - You must run the command as winpty vue.cmd create hello-world.
2 - If you still want to use the vue create hello-world syntax. You'll need to add the following line, alias vue='winpty vue.cmd', to your ~/.bashrc file. Then, you'll need to restart your Git Bash terminal session to pull in the updated bashrc file.

Git Bash is not an interactive shell. That's why you should use something that is by default interactive such as CMD or you have to do as mentioned in the Vue CLI doc:
If you are on Windows using Git Bash with minTTY, the interactive
prompts will not work. You must launch the command as winpty vue.cmd
create hello-world. If you however want to still use the vue create
hello-world syntax, you can alias the command by adding the following
line to your ~/.bashrc file. alias vue='winpty vue.cmd' You will need
to restart your Git Bash terminal session to pull in the updated
bashrc file.
Vue CLI is an interactive CLI. But Git Bash is not an interactive shell. That's why it won't work. Source

Related

WSL can't detect VS code

At first, I tried to fix my problem of npm instruction
so I added
[interop]
appendWindowsPath = false
to /etc/wsl.conf
It works, but another problem happen.
When I type code .
Command 'code' not found, did you mean:
command 'node' from deb nodejs (12.22.9~dfsg-1ubuntu3)
command 'cdde' from deb cdde (0.3.1-1build1)
command 'ode' from deb plotutils (2.6-11)
command 'tcode' from deb emboss (6.6.0+dfsg-11ubuntu1)
command 'cde' from deb cde (0.1+git9-g551e54d-1.2)
Try: sudo apt install <deb name>
The above Error message appear.
I tried the following instruction
export PATH=$PATH:"/mnt/c/Users/%USERNAME%/AppData/Local/Programs/Microsoft VS Code/bin"
It also works properly.
Whenever I restarted WSL, npm instruction still worked well, but code instruction lost its function again.
What should I do to fix the problem?
Thanks in advance!
My main suggestion would be to not use appendWindowsPath = false to fix your NPM problem. That's like using a sledgehammer as a flyswatter. As I said in this answer:
Please do not follow the recommendations (like this answer) to completely remove all Windows paths from WSL, as that will severely limit your ability to run Windows applications in WSL (one of its great features).
You'll also lose access to the ability to run PowerShell scripts and commands in WSL easily. You won't have direct access to wsl.exe itself from inside WSL (which comes in handy).
You can type the full paths to these commands, of course, but most instructions and other answers you find here are going to assume that you've left the Windows path intact.
Instead, figure out where npm is installed in your WSL distribution and then determine why it is further toward the end of the PATH than your Windows directories. Windows paths are added at the end of the Linux PATH for a reason. If something in your startup files is adding to the path, it should put it at the beginning, so it has precedence. E.g.:
export PATH="newdir:$PATH"
Note that I'm not saying that you should change your export statement above since, as mentioned, that Windows path would normally come at the end anyway. It's really not going to matter unless you put another code executable somewhere else in your path.
Whenever I restarted WSL, npm instruction still worked well, but code instruction lost its function again.
If you do want the "quick and dirty" (not recommended) solution, then you can simply add that export command that "makes it work" to your ~/.bashrc. That file is processed each time the Bash shell starts interactively.

lime test windows error command prompt not installed?

Everytime i load command prompt this always happens:
Me: cd Documents/Funkin-master
Me: Lime test windows
Error: You must have a "project.xml" file or specify another valid project file when using the 'test' command.
There is a Project.xml and I need to uninstall HaxeFlixel and reinstall a different version.
Someone help me please.
I WANNA MAKE MY OWN MOD.
I think you need to do "cd Documents/Funkin-master/Funkin-master" because I think you led to a directory that does not, in fact, have a project.xml. "cd Documents/Funkin-master" I think is just a folder containing a folder.
Oh! Also, if you need to update haxeflixel, the command is "haxelib update flixel".

ConEmu + WSL: Open new console in current tab directory

I'm using WSL and ConEmu build 180506. I'm trying to setup a task in ConEmu to use the current directory of the active tab when opening a new console but I cannot get it to work.
What I did is to setup the task {Bash: bash} using the instructions on this page
setting the task command as :
set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -C~ -cur_console:pm:/mnt
Then following the instruction on this page, I added to my .bashrc
if [[ -n "${ConEmuPID}" ]]; then
PS1="$PS1\[\e]9;9;\"\w\"\007\e]9;12\007\]"
fi
and finally setup a shortcut using the macro :
Shell("new_console", "{bash}", "", "%CD%")
But it always open the new console in the default directory ('/home/[username]').
I don't understand what I'm not doing right.
I also noticed that a lot of environment variables listed here are not set. Basically, only $ConEmuPID and $ConEmuBuild seem to be set.
Any help would be appreciated.
GuiMacro Shell was intended to run certain commands, not tasks.
You think you may try to run macro Task("{bash}","%CD%")
Or set your {bash} task parameters to -dir %CD% and just set hotkey for your task.
Of course both methods require working CD acquisition from shell. Seems like it's OK in your case - %d shows proper folder.
I found the answer:
Shell("new_console:I", "bash.exe", "", "%CD%")
The readme is actually pretty good: https://github.com/cmderdev/cmder/blob/master/README.md

LiteIDE no autocomplete

I'm trying to use LiteIDE (the Go IDE) on Linux 32-bit. Everything works except for autocomplete. Builds, running, everything works. The gocode binary seems to be running tho:
ithisa#miyasa ~> ps aux | grep gocode
ithisa 10003 0.0 0.0 823788 2624 pts/1 Sl+ 09:06 0:00 /home/ithisa/scratch/liteide/bin/gocode -s -sock unix -addr localhost:37373
What might I be doing wrong?
You may need to set a GOROOT=. To set it within LiteIDE, look for the environment toolbar; it should be a a dropdown, probably with "system" preselected, and a button. Click the button to bring up the Edit Environment pane, then double-click "system.env", or whichever environment was picked in the dropdown.
Change the line that starts GOROOT= to point to your 'go' directory. Plain old $HOME/go is a common setting if you installed it from golang.org, and if you don't know where it is, running go env will show the GOROOT that the Go toolchain itself is using. And of course if the line is commented out (#GOROOT=...) remove the #. Save.
If the toolbar is missing entirely, View -> Environment toolbar unhides it.
It's probably also worth setting GOROOT and related settings in your .bashrc, so tools started from the command line see it. I installed Go and LiteIDE in my homedir and my workspace is ~/gocode, so mine is like:
export PATH="$HOME/go/bin:$HOME/liteide/bin:$PATH"
export GOROOT=$HOME/go
export GOPATH=$HOME/gocode
I can't be certain this is actually your issue, but if I unset my GOROOT the symptom matches what you're seeing: completion works on my code, but not on the standard library. Good luck!
Did you install gocode?
https://github.com/nsf/gocode
Also, does nothing autocomplete or just new packages? Packages need to be installed to autocomplete. Do you have a standard install setup?
Your GOROOT and GOPATH should also be correctly setup.
I've got the exact same problem, except for 64-bit linux (ArchLinux)
I got this solved by:
set up correct GOROOT and GOPATH, for example:
$ cat ~/.bashrc | grep GO
export GOROOT=/usr/lib/go
export GOPATH=~/goroot
PATH="$PATH:$GOPATH/bin"
bash
installing/starting gocode daemon
$ go get -u github.com/nsf/gocode
$ gocode -addr=:37373
$ gocode status
set correct GOROOT on LiteIDE config file:
sudo vim /usr/share/liteide/liteenv/linux64.env
GOROOT=/usr/lib/go
For me gocode (autocomplete) broke in LiteIDE after updating Go to the latest version.
What I did was make sure GOPATH was set correct. Then install gocode:
go get -u github.com/nsf/gocode
Then remove the gocode version from the liteide/bin/ folder, because else LiteIDE will use its own version (I only renamed it just in case).
Now when you boot LiteIDE it should say
GolangCode: Found gocode at <YOUR GOPATH>/bin/gocode
instead of LiteIDE using its own version.

The local psql command could not be located

I'm following the instructions found here.
When I try to run $ heroku pg:psql or $ heroku pg:psql HEROKU POSTGRESQL_BROWN I recieve the following error message:
! The local psql command could not be located ! For help
installing psql, see local-postgresql
I can't find anything useful on the link it gives me (it just links to the instructions I was already using, but further down the page) nor can I find this error anywhere else.
If I've missed anything you need to know to answer this, just let me know. I'm rather new to all this and teaching myself as I go.
I had same error even after installing Postgres locally.
But after seeing this
I saw that "pqsl" was not in the PATH so I then did
PATH=%PATH%;C:\Program Files\PostgreSQL\9.2\bin
which worked for me
I have since solved this myself. When I ran heroku pg:info it says the version number is 9.1.8, I was locally running 9.2
installing 9.1.8 and ensuring Path pointed to the appropriate folder solved the problem.
After you change the path, make sure to restart the terminal!
Set the PATH. To find out the PATH of your psql script (on mac) open the sql shell script from your finder in Applications/Postgres installation. This will give you a hint as to where it is installed. That opened a window which told me it is located here: /Library/PostgreSQL/8.4/scripts/runpsql.sh
Then, I set the PATH variable from the terminal window by typing:
$ PATH="/Library/PostgreSQL/8.4/bin:$PATH"
(depends on the location of your PostgreSQL installation, find your bin path first, another exp: /usr/local/Cellar/postgresql#9.6/9.6.8/bin)
OR.....
You can also connect to the shell by opening the shell directly from your postgres installation folder. Then enter the credentials. If you don't know the credentials, here is how to find them out:
$ heroku pg:info
=== HEROKU_POSTGRESQL_RED_URL (DATABASE_URL)
$ heroku pg:credentials HEROKU_POSTGRESQL_RED_URL
Top answer wouldn't work for me oddly, my system would not add the Path via cmd with administrator access (Not sure why).
So check this > Windows key > environment variables > system variables
And add the last line (your version may differ in the path)
Make sure you've installed the toolbelt as psql is installed by default.
However you also need to ensure you've installed a local copy of PostgreSQL; if you don't the toolbelt will be unable to find the native psql client.
Assuming you have installed a local copy of PostgreSQL, make sure you can execute psql from the command line directly (i.e make sure you PATH is set correctly ). If the command does not execute, check your PATH, if it does execute see if you can connect via the PSQL connection string provided in the Heroku control panel. If you can connect reinstall the toolbelt, if you are unable to connect provision another dev database and try again.
If there are still issues, I would suggest contacting Heroku support for assistance after verifying no API issues are listed on the status page located here.
I got rid if this annoying message on Windows by adding a path element without the spaces, i.e.
C:\Progra~1\PostgreSQL\9.4\data
instead of
“C:\Program Files\PostgreSQL\9.4\data”
I followed the instructions here: http://www.computerhope.com/issues/ch000549.htm, which worked for me if you prefer to go the point-and-click configuration of the PATH variable.
This type of error usually appears in the Windows environment, because if you do not update the PATH after installing Postgresql, heroku pg:psql command does not work.
So you need to update your PATH environment variable to add the bin directory of your Postgres installation. The directory will look like this:
C:\Program Files\PostgreSQL\<VERSION>\bin.
For more information, go to the Heroku in Local setup website:
heroku-postgresql: Local setup
I had the same problem and discovered that Heroku doesn't seem to provision the latest version of PostgreSQL by default. Where the Heroku Getting Started instructions said
heroku addons:create heroku-postgresql:hobby-dev
That provisioned a v10 database for some reason (which you can check by clicking on Heroku Postgres in the Add-ons tab of your dashboard). I deleted that database and provisioned a new database using the --version flag:
heroku addons:create heroku-postgresql:hobby-dev --version 11
As of now, at least, you can find the latest version of Postgres supported by Heroku at this link: https://devcenter.heroku.com/articles/heroku-postgresql#version-support-and-legacy-infrastructure
I'm writing this in early 2019, but according to the PostgreSQL website the next version (12) is "tentatively scheduled" for third quarter of 2019 so if you're reading this in late 2019 potentially the same problem will come up for v12 instead
On Mac you can use the following:
export PATH="/Library/PostgreSQL/12/bin/:$PATH"
The only solution that I found on Windows:
go to advanced system settings
go to environment variables
select Path variable and click Edit
add a new line and enter your bin directory path (C:\Program Files\PostgreSQL<version>\bin) and click ok
restart your terminal
enter your psql command (heroku pg:psql)