ubuntu下安装vue/cli提示No command 'vue' found_咋地 _前端开发者

通过官方指令

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
    
  • Back up your computer.
  • On the command line, in your home directory, create a directory for global installations:
     mkdir ~/.npm-global
    
  •  mkdir ~/.npm-global
    
     mkdir ~/.npm-global
    
     mkdir ~/.npm-global
    

    mkdir ~/.npm-global

  • Configure npm to use the new directory path:
     npm config set prefix '~/.npm-global'
    
  •  npm config set prefix '~/.npm-global'
    
     npm config set prefix '~/.npm-global'
    
     npm config set prefix '~/.npm-global'
    

    npm config set prefix '~/.npm-global'

  • In your preferred text editor, open or create a ~/.profile file and add this line:
     export PATH=~/.npm-global/bin:$PATH
    
  • ~/.profile

     export PATH=~/.npm-global/bin:$PATH
    
     export PATH=~/.npm-global/bin:$PATH
    
     export PATH=~/.npm-global/bin:$PATH
    

    export PATH=~/.npm-global/bin:$PATH

  • On the command line, update your system variables:
     source ~/.profile
    
  •  source ~/.profile
    
     source ~/.profile
    
     source ~/.profile
    

    source ~/.profile

  • To test your new configuration, install a package globally without using sudo:
     npm install -g jshint
    
  • sudo

     npm install -g jshint
    
     npm install -g jshint
    
     npm install -g jshint
    

    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):

    ~/.profile

        NPM_CONFIG_PREFIX=~/.npm-global
        NPM_CONFIG_PREFIX=~/.npm-global
        NPM_CONFIG_PREFIX=~/.npm-global

    NPM_CONFIG_PREFIX=~/.npm-global

    » 本文来自:前端开发者 » 《ubuntu下安装vue/cli提示No command 'vue' found_咋地 _前端开发者》
    » 本文链接地址:https://www.rokub.com/73677.html
    » 您也可以订阅本站:https://www.rokub.com
    赞(0)
    64K

    评论 抢沙发

    评论前必须登录!