N
N
Nurislam Nagashybai2022-04-09 20:55:53
Node.js
Nurislam Nagashybai, 2022-04-09 20:55:53

Why doesn't NODE_OPTIONS work?

I want to add a Debug command, I added the configuration

{
  // Use IntelliSense to learn about possible 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": "attach",
      "name": "Launch Program",
      "skipFiles": [
        "<node_internals>/**"
      ],
      "port": 9229
    }
  ]
}


And the team itself
"scripts": {
    "dev": "next dev",
    "debug": "NODE_OPTIONS='--inspect' next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint",
    "stylelint": "stylelint \"**/*.css\"--fix"


I run it on the command line and get the error
"NODE_OPTIONS" is not an internal or external
command, operable program or batch file.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Shipin, 2022-04-11
@Akanur

1. install cross-env ( npm i -D cross-env)
2. point in the "scripts" section to the desired cross-env command, for example:

"debug": "cross-env NODE_OPTIONS='--inspect' next dev"

3. use on health

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question