Giter VIP home page Giter VIP logo

Comments (4)

Molunerfinn avatar Molunerfinn commented on May 14, 2024

这个报错是不是因为你的node版本并没有在7.6之上呢?async、await的语法需要在node7.6以上才能实现。
我的launch.json配置如下:

{
  // Use IntelliSense to learn about possible Node.js debug attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [

    {
      "type": "node",
      "request": "launch",
      "name": "Launch Program",
      "program": "${file}"
    },
    {
      "type": "node",
      "request": "attach",
      "name": "Attach to Port",
      "address": "localhost",
      "port": 9229,
      "restart": true
    }
  ]
}

需要先用nodemon运行项目再进行调试,因为是attach to port的方式。注意看我package.json里的npm run server 跑的命令。

from vue-koa-demo.

huoyanwuzhe629 avatar huoyanwuzhe629 commented on May 14, 2024

node 版本7.6.0,launch.json使用你上面的配置,启动调试,ide报错:
"无法启动程序”/Users/xiongsheng/personal_project/Github/vue-koa-demo/.vscode/launch.json“;设置”outFiles“属性可能会有帮助"
npm run server执行是成功的

from vue-koa-demo.

Molunerfinn avatar Molunerfinn commented on May 14, 2024

看了一下是vscode更新导致的。另外由于它的更新现在可以直接配置nodemon调试了。所以我更新了一下调试的配置,直接通过debug来启动server端就行了。注意在debug的时候需要选择一下你使用的配置,是从nodemon启动的:
image

{
      "type": "node",
      "request": "launch",
      "name": "nodemon",
      "runtimeExecutable": "nodemon",
      "program": "${workspaceFolder}/server-entry.js",
      "restart": true,
      "console": "integratedTerminal",
      "internalConsoleOptions": "neverOpen"
    }

from vue-koa-demo.

huoyanwuzhe629 avatar huoyanwuzhe629 commented on May 14, 2024

哈哈哈,总算搞定了,非常感谢

from vue-koa-demo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.