最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to run npm script in visual studio code launch.json file - Stack Overflow

programmeradmin0浏览0评论

I am trying to run the follwowing npm script in Visual Studio code's launch.json file:

nodemon src/shim-host/index.js --exec babel-node --babel-preset-es2015

My attempt so far in my launch.json file:

"program": "nodemon src/shim-host/index.js --exec babel-node --babel-preset-es2015",

However, I am getting the error "Attribute 'program' is not absolute'"

Can someone help?

Thanks in advance!

I am trying to run the follwowing npm script in Visual Studio code's launch.json file:

nodemon src/shim-host/index.js --exec babel-node --babel-preset-es2015

My attempt so far in my launch.json file:

"program": "nodemon src/shim-host/index.js --exec babel-node --babel-preset-es2015",

However, I am getting the error "Attribute 'program' is not absolute'"

Can someone help?

Thanks in advance!

Share Improve this question asked Jun 23, 2017 at 16:19 John GraysonJohn Grayson 1,5164 gold badges23 silver badges34 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6

The program attribute is your code and nodemon should be the runtimeExecutable.

Example from Visual Studio Code documentation:

{
    "name": "Launch server.js via nodemon",
    "type": "node",
    "request": "launch",
    "cwd": "${workspaceRoot}",
    "runtimeExecutable": "nodemon",
    "runtimeArgs": [
        "--debug=5858"
    ],
    "program": "${workspaceRoot}/server.js",
    "restart": true,
    "port": 5858,
    "console": "integratedTerminal",
    "internalConsoleOptions": "neverOpen"
}
发布评论

评论列表(0)

  1. 暂无评论