Vue CLI fails on Windows Powershell
See original GitHub issueVersion
3.4.0
Environment info
Environment Info:
System:
OS: Windows 10
CPU: (16) x64 AMD Ryzen 7 1700X Eight-Core Processor
Binaries:
Node: 11.9.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.13.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.5.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: 44.17763.1.0
npmGlobalPackages:
@vue/cli: Not Found
Steps to reproduce
Install Vue CLI using npm by running npm i -g @vue/cli
Open powershell as either standard or admin user.
run vue create test
in powershell
What is expected?
Vue should run its cli to create a new project without errors
What is actually happening?
Vue CLI fails in only powershell due to apparent syntax errors. It appears to work fine in cmd.
PS C:\Users\natty> vue create test
At C:\Users\natty\AppData\Local\Yarn\bin\vue.ps1:5 char:13
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
~
Unexpected token ')' in expression or statement.
At C:\Users\natty\AppData\Local\Yarn\bin\vue.ps1:8 char:3
if [ -x "$basedir/pwsh" ]; then
~
Missing '(' after 'if' in if statement.
At C:\Users\natty\AppData\Local\Yarn\bin\vue.ps1:8 char:5
if [ -x "$basedir/pwsh" ]; then
~
Missing type name after '['.
At C:\Users\natty\AppData\Local\Yarn\bin\vue.ps1:9 char:20
... sedir/pwsh" "$basedir/../Data/global/node_modules/.bin/vue.ps1" "$@"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unexpected token '"$basedir/../Data/global/node_modules/.bin/vue.ps1"' in expression or statement.
At C:\Users\natty\AppData\Local\Yarn\bin\vue.ps1:9 char:72
... sedir/pwsh" "$basedir/../Data/global/node_modules/.bin/vue.ps1" "$@"
~~~~
Unexpected token '"$@"' in expression or statement.
CategoryInfo : ParserError: (:) [], ParseException
FullyQualifiedErrorId : UnexpectedToken
PS C:\Users\natty>
Issue Analytics
- State:
- Created 5 years ago
- Comments:25 (1 by maintainers)
Top Results From Across the Web
How can i install vue cli? - node.js
Solution: delete the erroring file: File C:\Users\halva\AppData\Roaming\npm\vue.ps1. Sidenote: What I suggest is to not use powershell, and use ...
Read more >'vue' is not recognized as an internal or external command
To solve the error "'vue' is not recognized as an internal or external command, operable program or batch file", install the @vue/cli package...
Read more >Cannot find module '... \cli\bin\vue.js'
Running vue in powershell just gives an error: Cannot find module '. ... find module 'C:\Windows\System32\node_modules@vue\cli\bin\vue.js'
Read more >Install Vue.js on WSL
Vue CLI is a toolkit for working with Vue in your terminal / command line. It enables you to quickly scaffold a new...
Read more >Vue JavaScript Tutorial in Visual Studio Code
js framework, you can find great documentation and tutorials on the vuejs.org website. To install and use the Vue CLI as well as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
my work-around: Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
It might be slightly misleading to use NPM in the “Steps to reproduce” when the issue is related to a specific version of Yarn.
Also, to circumvent the issue until it is fixed, you can just call the
.cmd
-shim directly to avoid the faulty PowerShell-shim, i.e.vue.cmd create test
.