• vue项目启动报错 spawn cmd ENOENT errno


    START

    • 运行vue项目(npm run dev)报错
    • 报错如下
    DONE  Compiled successfully in 11178ms                                                                      下午3:42:04
    
    
      App running at:
      - Local:   http://localhost:8080/
      - Network: unavailable
    
      Note that the development build is not optimized.
      To create a production build, run npm run build.
    
    events.js:292
          throw er; // Unhandled 'error' event
          ^
    
    Error: spawn cmd ENOENT
        at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
        at onErrorNT (internal/child_process.js:465:16)
        at processTicksAndRejections (internal/process/task_queues.js:80:21)
    Emitted 'error' event on ChildProcess instance at:
        at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
        at onErrorNT (internal/child_process.js:465:16)
        at processTicksAndRejections (internal/process/task_queues.js:80:21) {
      errno: -4058,
      code: 'ENOENT',
      syscall: 'spawn cmd',
      path: 'cmd',
      spawnargs: [ '/c', 'start', '""', '/b', 'http://localhost:8080/' ]
    }
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! app@0.1.0 serve: `vue-cli-service serve`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the app@0.1.0 serve script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     D:
    ode
    ode_cache\_logs2020-12-19T07_42_04_693Z-debug.log
    

    解决

    • 原因: 电脑缺少cmd运行程序的环境变量
    • 解决方法
     
    环境变量配置图解.png

    END

    • 可以总结一下啊 spawn xxx ENOENT 其实就是缺少,对应的运行程序的环境变量(系统环境变量中Path中添加C:WindowsSystem32)。


    分享到:
  • 相关阅读:
    JLOI2012:时间流逝
    bzoj 5217: [Lydsy2017省队十连测]航海舰队
    bzoj 4894: 天赋
    bzoj 4870: [Shoi2017]组合数问题
    bzoj 1558: [JSOI2009]等差数列
    bzoj 4945: [Noi2017]游戏
    bzoj 2142: 礼物
    bzoj 5248: [2018多省省队联测]一双木棋
    51nod2383
    codeforces24D
  • 原文地址:https://www.cnblogs.com/qqflying/p/15488989.html
Copyright © 2020-2023  润新知