欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

ubuntu下安装vue/cli提示No command 'vue' found

程序员文章站 2022-04-21 16:40:44
通过官方指令 npm install -g @vue/cli 安装vue脚手架提示: No command 'vue' found, did you mean: Command 'vpe' from package 'texlive-latex-extra' (universe)vue: comma ......

通过官方指令

npm install -g @vue/cli

安装vue脚手架提示:

no command 'vue' found, did you mean:
command 'vpe' from package 'texlive-latex-extra' (universe)
vue: command not found

解决方法:

  1. back up your computer.
  2. on the command line, in your home directory, create a directory for global installations:
     mkdir ~/.npm-global
    
  3. configure npm to use the new directory path:
     npm config set prefix '~/.npm-global'
    
  4. in your preferred text editor, open or create a ~/.profile file and add this line:
     export path=~/.npm-global/bin:$path
    
  5. on the command line, update your system variables:
     source ~/.profile
    
  6. to test your new configuration, install a package globally without using sudo:
     npm install -g jshint
    

instead of steps 2-4, you can use the corresponding env variable (e.g. if you don’t want to modify ~/.profile):

    npm_config_prefix=~/.npm-global