zoukankan      html  css  js  c++  java
  • npm run dev报错,events.js:160 throw er; // Unhandled 'error' event

    错误代码如下:

    vue-project@1.0.0 dev E:MySoftwaretestGitwebpackvue-projectnode build/dev-server.js "8088"
    events.js:160
    
      throw er; // Unhandled 'error' event
      ^
    Error: listen EACCES 0.0.0.0:8080
    
    at Object.exports._errnoException (util.js:1026:11)
    at exports._exceptionWithHostPort (util.js:1049:20)
    at Server._listen2 (net.js:1244:19)
    at listen (net.js:1293:10)
    at Server.listen (net.js:1389:5)
    at EventEmitter.listen (E:MySoftware	estGitwebpackvue-project
    ode_modulesexpresslibapplication.js:617:24)
    at Object.<anonymous> (E:MySoftware	estGitwebpackvue-projectuilddev-server.js:62:22)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3

    解决方案:

    网上找很多帖子,都没有写解决办法,自己来喽,也是神奇的错误

    最后,神奇的是,错误居然被哦改好了

    解决办法

    进入 vue-demo/config/index.js

    dev: {
        env: require('./dev.env'),
        port: 8088,        # 注意了啊。。。修改成你要的端口,接着运行代码就看到效果了
        assetsSubDirectory: 'static',
        assetsPublicPath: '/',
        proxyTable: {},
        // CSS Sourcemaps off by default because relative paths are "buggy"
        // with this option, according to the CSS-Loader README
        // (https://github.com/webpack/css-loader#sourcemaps)
        // In our experience, they generally work as expected,
        // just be aware of this issue when enabling this option.
        cssSourceMap: false
      }

    然后运行就变成8088端口了。

  • 相关阅读:
    三层架构之解耦
    自动升级 组件
    C语言常量与指针
    ASP.NET MVC Model元数据
    Web层后端权限模块
    java中文排序问题(转)
    JDWP
    bat执行java程序的脚本解析
    jdom dom4j解析xml不对dtd doctype进行验证(转)
    Dom4j SAXReader Constructors
  • 原文地址:https://www.cnblogs.com/wpcnblog/p/6489874.html
Copyright © 2011-2022 走看看