美文网首页
vue 环境搭建问题

vue 环境搭建问题

作者: cain07 | 来源:发表于2020-07-23 13:39 被阅读0次

1. 无法安装vue-cli

在网上查的,是因为os版本过高的问题。安装 npm install -g @vue/cli时会出现这个问题

npm WARN deprecated fsevents@1.2.9: One of your dependencies needs to upgrade to fsevents v2: 1) Proper nodejs v10+ support 2) No more fetching binaries from AWS, smaller package size
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!  { [Error: EACCES: permission denied, access '/usr/local/lib/node_modules']
npm ERR!   stack:
npm ERR!    'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules' }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/dove/.npm/_logs/2019-11-14T07_30_27_188Z-debug.log

解决办法:
在终端输入这个命令

sudo chown -R $(whoami) /usr/local/*

然后再运行npm install -g @vue/cli就可以正常安装了。

2. 安装vue-cli之后,发现终端并没有vue

终端输入vue,发现未找到,command not find:vue
这个问题应该是环境变量没配置,配置一下环境变量

首先安装一下vue-cli

sudo npm intall -g vue-cli
就算上面安装了@vue/cli,这个vue-cli也是要安装的
安装后是这样的

image.png

继续在终端输入export PATH="PATH:/usr/local/bin/vue",PATH:后面这个就是上图中标红的
到此vue就可以正常使用了

相关文章

  • 前端环境搭建

    前端开发环境的搭建 vue环境搭建(node,vue-cli,vue) https://www.jianshu.c...

  • vue项目搭建 2019-03-19

    主要步骤: 1.前端环境搭建; 2.vue项目环境的搭建。 最近想找实习,发现了一个问题:大家对vue框架都是情有...

  • vue 环境搭建问题

    1. 无法安装vue-cli 在网上查的,是因为os版本过高的问题。安装 npm install -g @vue/...

  • vue+ionic

    vue的环境搭建: npm install -g @vue/cli (若已搭建跳过)vue create i...

  • Vue2.0 生产环境部署

    简要:继上次搭建vue环境后,开始着手vue的学习;为此向大家分享从开发环境部署到生产环境(线上)中遇到的问题和解...

  • Vue之ToDoList实战

    之前的文章windows下搭建vue开发环境,我们已经搭建好了vue的环境,并且写了Vue系列之WebPack与E...

  • vue-vscode开发环境搭建

    vue-vscode环境搭建

  • Mac上搭建vue环境

    // 转发自:vue开发环境搭建Mac版 vue开发环境的搭建由于本人使用的是mac,所以环境是windows的下...

  • Vue环境搭建

    描述vue环境的搭建以及搭建过程遇到的问题 安装npm 前往nodejs官网下载nodejs,(https://n...

  • Plan

    一:Plan On Work:知识点 1、vue(MVVM、vue原理、使用中遇到的问题、相关插件、环境搭建) 2...

网友评论

      本文标题:vue 环境搭建问题

      本文链接:https://www.haomeiwen.com/subject/hmttlktx.html