skip to Main Content

I created an angular project in visual studio code(version 1.81.1). but when I try to run the program using "ng serve" command give below error.(Node version : 20.6.0,npm version : 10.0.0)

Cannot redefine property: File

This is the error message

Execution policies set as below

execution policies

Can give any reason for the issue?

3

Answers


  1. Chosen as BEST ANSWER

    When I uninstalled node version 20.6.1 and installed node version 18.17.1, issue was fixed


  2. There is an issue with node 20.6 that breaks babel. The fix for node has landed but not been released yet.

    Downgrading to any previous version of Node (below 20.6) will fix the issue.


    Babel has introduced a workaround in 7.22.17 with #15947 with allow Angular to run with 20.6.

    Login or Signup to reply.
  3. upgrade to 20.6.1 and the problem will dissapear

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search