I'm trying run the vue command on the Windows command prompt.
I installed Node and then Vue CLI by using command npm install -g #vue/cli, but when I run vue create test, I see an error. I reinstalled Node and #vue/cli, but that didn't work. Here's the error:
Vue CLI requires Node 8.9+, as stated in the docs:
Node Version Requirement
Vue CLI requires Node.js version 8.9 or above (8.11.0+ recommended). You can manage multiple versions of Node on the same machine with nvm or nvm-windows.
The error indicates a syntax error for the async keyword, which is not supported in older versions of Node.
Related
I have a problem when I use the npm command. why when I use the npm command to check the version program must use npx? it does not work when I don't use npx
For example when I use Vue --version to check cli vue version
vue --version
bash: vue: command not found
npx vue --version
#vue/cli 5.0.6
npx error
Try updating your PATH variable with this command:
export PATH=$PATH:/Users/denis/.npm-global/bin
Updating Node/NPM might help too.
I installed vue using
npm install vue
But the terminal wasn't recognizing "vue" command (like vue --version), so I hitted:
npm install -g vue-cli#2.7.0
And now it says I have version 2.7.0 when I check the version, but it doens't respond neither shows any error when I try:
vue ui
It just doesn't run. Can anyone help?
That is no longer the name of the Vue CLI package. You will need to install from #vue/cli as detailed here: https://cli.vuejs.org/guide/installation.html
First, some environment details -
Virtual Box 6.0
guest OS: Ubuntu 18.04
host OS: Windows 10
package versions on guest -
nodeJS 8.10.0
npm 3.5.2
expo-cli 3.9.1
vue-native-cli 0.1.1
Now for the issue and question -
When the vue-native init my-vue-app command is executed while in a location in the home directory of the guest the response is the following:
An error occurred while getting Expo CLI version
Please globally install expo-cli
However, Expo CLI is installed globally
What is causing this error when Expo CLI is already installed globally? What should be done to get the vue-native init my-vue-app command to execute successfully?
I was able to get the vue-native init my-vue-app command working by starting with a clean VM and doing the package installation differently than on the first VM. Two changes were made on the second VM:
Node version manager (called n) was used to install NodeJS and npm (rather than using curl)
Expo CLI was installed globally using npm (not Yarn)
I'm not sure if one of these changes or both were necessary to get Vue Native to work because they were not tested separately but Vue Native is working now! Woo hoo!
Here is a screenshot of the package versions on the working VM:
I'm trying to execute 'vue serve' using my installed vue cli.
I've done the following:
npm -g install #vue/cli <-- works ok.
npm -g install #vue/cli-service-global <-- seems to install package ok.
I then try to execute a 'vue serve' command and receive the error:
"Command vue serve requires a global addon to be installed.
Please run npm install -g #vue/cli-service-global and try again."
vue cannot see the addon.
Any know why ?
Thanks in advance.
Check your #vue/cli and #vue/cli-service-global package versions. If the versions are not compatible, that could be the issue.
Also, are you running this on a Windows machine but from a MING terminal? I've had subtle permission issues with trying to run #vue/cli from a non-windows terminal. You might try deleting your node_packages/ directory and running npm install from a Windows Command Prompt if you are on a Windows machine.
I am having trouble with this error, my project need run angular/cli version 1.7.4 and Nodejs 6.10.3 .But the past I used angular cli version 6 and now I want to downgrade to angular cli 1.7.4 but I don't know how to downgrade angular cli version 6 at my global. I try to use npm uninstall -g #angular/cli and then I install the version I want by command npm install -g #angular/cli#1.7.4 but when I check ng -v it's still have a error in picture
P/S: I were updated my npm to latest version to make sure can remove angular cli version but still don't work
Keep your global package running at the highest version. If a project needs CLI 1.x, use the npm run commands instead.
Any npm commands run use the project's CLI, not your global version.