• VScode---使用visual studio code遇到的错误


    错误1:直接用VS Code 打开项目,在终端输入npm run dev的时候,提示错误信息:

                 'vue-cli-service' 不是内部或外部命令,也不是可运行的程序 或批处理文件。

    认真看了一下提示,是因为没有node_modules。

    直接用npm install来运行。运行结束后发现有node_modules文件夹了,再次npm run dev成功.

    错误二:使用npm 安装vue的时候突然报错了,找了半天只有让清缓存 !终于解决!

    报错如下

    npm ERR! code EPERM
    npm ERR! syscall mkdir
    npm ERR! path C:Program Files
    odejs
    ode_cache\_cacache
    npm ERR! errno -4048
    npm ERR! Error: EPERM: operation not permitted, mkdir 'C:Program Files
    odejs
    ode_cache\_cacache'
    npm ERR!  [OperationalError: EPERM: operation not permitted, mkdir 'C:Program Files
    odejs
    ode_cache\_cacache'] {
    npm ERR!   cause: [Error: EPERM: operation not permitted, mkdir 'C:Program Files
    odejs
    ode_cache\_cacache'] {
    npm ERR!     errno: -4048,
    npm ERR!     code: 'EPERM',
    npm ERR!     syscall: 'mkdir',
    npm ERR!     path: 'C:\Program Files\nodejs\node_cache\_cacache'
    npm ERR!   },
    npm ERR!   isOperational: true,
    npm ERR!   errno: -4048,
    npm ERR!   code: 'EPERM',
    npm ERR!   syscall: 'mkdir',
    npm ERR!   path: 'C:\Program Files\nodejs\node_cache\_cacache'
    npm ERR! }
    npm ERR!
    npm ERR! The operation was rejected by your operating system.
    npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
    npm ERR! or that you lack permissions to access it.
    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.

    解决方法一:.删除.npmrc文件(不建议)
    该文件在:C:Users{账户}下,一般这种类型的都是默认被隐藏,一定要选择将隐藏取消掉

    如果用了方法一,确实不报错了,但是安装的路径还是会到默认路径,可以打开npmrc文件看一下里面的配置

    解决方法二:在管理员的身份下执行命令清理就行,控制台输入下方命令,再执行安装即可。

    npm cache clean --force

    Win10怎么以管理员身份运行CMD命令提示符

    方法一:我们可以在Windows10系统的开始菜单上,单击鼠标右键,这时候出现的菜单中,我们选择命令提示符(管理员)点击打开这样即可。

    方法二:先在Windows10系统的搜索框中直接输入命令CMD。

    然后搜索结果中,还是在命令提示符上单击右键,选择管理员身份运行。

     
    我话讲完!谁赞成?谁反对?
  • 相关阅读:
    scala简单的功能实现~weektwo
    linux中/dev/null与2>&1讲解
    scala简单的功能实现~weekone
    oracle之随机数
    oracle之percent_rank() over()函数和PERCENTILE_CONT() within group()over()函数详解
    awk编程的基本用法
    Django-路由系统
    selectors模块
    threading中定时器Timer方法
    HTML-W3school首页制作
  • 原文地址:https://www.cnblogs.com/wffzk/p/15159207.html
Copyright © 2020-2023  润新知