如何在WebStorm中调试yarn / npm

问题描述 投票:0回答:1

通常我使用yarn,并使用Node.js启动我的yarn start应用。我在WebStorm中尝试了同样的方法对其进行调试,但应用程序无法在浏览器中启动,这是怎么回事?我可以启动应用程序,但不能调试它。

enter image description here

Package.json:

{
  "name": "ticket",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@material-ui/core": "^4.6.1",
    "@material-ui/icons": "^4.5.1",
    "axios": "^0.19.0",
    "facebookgraph": "^0.4.0",
    "react": "^16.11.0",
    "react-dom": "^16.11.0",
    "react-facebook-login": "^4.1.1",
    "react-scripts": "3.2.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "prettier": "^1.19.1",
    "pretty-quick": "^2.0.1"
  }
}
debugging npm webstorm yarn
1个回答
0
投票

WebStorm默认读取package.json并将所有命令放在左侧菜单中

enter image description here

因此,如果您想添加更多命令,只需在package.json中编辑脚本部分

enter image description here

您可以在启动时单击例如将运行的脚本

© www.soinside.com 2019 - 2024. All rights reserved.