-2

I see a debug msg in VS code in the following code just above "scripts" (between line 3 and 4). Please let me know the best way to perform the debug. Thanks!

{
    "name": "travel-site",
    "version": "1.0.0",
    "scripts": {
      "dev": "webpack serve",
      "build": "webpack",
      "test": "echo \"Error: no test specified\" && exit 1"
    },
    "dependencies": {
      "axios": "^0.21.1",
      "lazysizes": "^5.3.0",
      "lodash": "^4.17.20",
      "normalize.css": "^8.0.1",
      "react": "^17.0.1",
      "react-dom": "^17.0.1"
    },
    "devDependencies": {
      "@babel/core": "^7.12.13",
      "@babel/preset-env": "^7.12.13",
      "@babel/preset-react": "^7.12.13",
      "autoprefixer": "^10.2.4",
      "babel-loader": "^8.2.2",
      "clean-webpack-plugin": "^3.0.0",
      "css-loader": "^5.0.1",
      "css-minimizer-webpack-plugin": "^1.2.0",
      "fs-extra": "^9.1.0",
      "html-webpack-plugin": "^5.0.0",
      "mini-css-extract-plugin": "^1.3.5",
      "postcss-import": "^14.0.0",
      "postcss-loader": "^5.0.0",
      "postcss-mixins": "^7.0.2",
      "postcss-nested": "^5.0.3",
      "postcss-simple-vars": "^6.0.3",
      "style-loader": "^2.0.0",
      "webpack": "^5.20.1",
      "webpack-cli": "^4.5.0",
      "webpack-dev-server": "^3.11.2"
    }
}
Sadra Saderi
  • 52
  • 1
  • 8
  • See https://stackoverflow.com/a/62368407/836330 It is not for debugging your package.json but any scripts you may have in there. – Mark Feb 06 '21 at 16:34
  • see https://stackoverflow.com/questions/43210203/what-is-the-proper-way-to-debug-an-npm-script-using-vscode for a great example of how to ask this question and a great answer – shirleyquirk Feb 07 '21 at 02:37

1 Answers1

0

This line is not valid:

"test": "echo "Error: no test specified" && exit 1"

Maybe you meant:

"test": "echo 'Error: no test specified' && exit 1"

(And please format your code appropriately on Stackoverflow questions, you have the {} icon for that).

Guillermo Brachetta
  • 3,857
  • 3
  • 18
  • 36
  • The debug message is still there. I used the code icon to paste in the code but no idea why it came out like this. This is my very first post here so I have to get familiar with a lot of stuff I guess! – maz-isl Feb 06 '21 at 13:45
  • No problem, just select the code bit of your question and click on the code icon for it to be formatted. To debug your React app you need to configure the debugger creating a launch.json file. See if this link helps: https://medium.com/@auchenberg/live-edit-and-debug-your-react-apps-directly-from-vs-code-without-leaving-the-editor-3da489ed905f – Guillermo Brachetta Feb 06 '21 at 15:07