Home > database >  when running npm install --legacy-peer-deps, got error: Debug Failure. Unhandled SyntaxKind: Unknown
when running npm install --legacy-peer-deps, got error: Debug Failure. Unhandled SyntaxKind: Unknown

Time:09-03

I am trying to run npm install --legacy-peer-deps

but got some error.

here is the error:

Error: Error on worker #1: Error: Debug Failure. Unhandled SyntaxKind: Unknown.     
    at pipelineEmitWithHintWorker (portal/node_modules/typescript/lib/typescript.js:113076:22)

Also I added a log on this line typescript.js:113076:22

            console.log(node, node.kind)

            ts.Debug.fail("Unhandled SyntaxKind: ".concat(ts.Debug.formatSyntaxKind(node.kind), "."));

the output is

t undefined

I think it might be a node version issue, but not sure what is happening, if anyone can help, I am very appreciated. Let me know if anymore infomation need to be provided.

CodePudding user response:

I had this issue today too. I found that targeting Typescript < 4.8 was the key to resolving this issue.

In your package.json change your typescript version (dev dependency) to something akin to this: "typescript": "<4.8" or specifically set the version eg "typescript": "4.6.4"

You should check the node_modules folder to ensure that you did not install the 4.8.2 package which I think has this incompatability.

  • Related