Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 702 Vote(s) - 3.46 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Windows Script Host Error: Invalid character - Code:800A03F6 - Source: Microsoft JScript compilation error

#1
I'm having an issue with Powershell and CMD. When I try to execute Angular CLI commands in CMD like `ng --version` or `ng new projectName`, I get this error;

> **Windows Script Host Error**: Invalid character
>
> **Code**: 800A03F6
>
> **Source**: Microsoft JScript compilation error

![img1][1]

[1]:
Reply

#2
Update:

On Windows .js files are associated to Windows Scripting Host by default, so the script will not be run with Node.

Open a file explorer and find a JavaScript file, open the JavaScript file's properties and then "open with", select the Node.js program file to open that kind of files.

The error should stop after doing this.
Reply

#3
Installing this exact Angular version:

```shell
npm -g install @angular/[email protected]
```

instead of the latest version:

```shell
npm -g install @angular/cli
```

fixed the above error.
Reply

#4
This is how I solved it: (on windows 10)

Go to C:\Users\<your_username>\AppData\Roaming\npm\node_modules\@angular\cli\bin

Check for ng.js

Right click on ng.js file and click on "`properties`" option

You need to open it with node.exe so click on "Change" button go to node js installed directory and

(example: C:\Program Files\nodejs\node.exe)

Select node.exe

Click on OK

It should change the color of ng.js like below:

[![enter image description here][1]][1]


[1]:


Now try ng -v and other ng commands

Reply

#5
I ran into this exact issue after updating to Angular CLI 13. Tried tons of different suggestions from other threads. What is described in the solutions here is essentially what worked for me, but I just want to point out a possible alternative method to applying the fix that doesn't associate all JS files with node.js.

[To see links please register here]


In your windows system environment variables is one variable called PATHEXT. If the value contains `.JS;`, remove it. Then restart your CMD windows.
Reply

#6
make sure you have proper path variable configured as shown below

Go to your system variable settings

[path variable snapshot][2]


make sure you have all these mentioned as part of path
C:\Users\<userfolder>\AppData\Roaming\npm\node_modules\@angular\cli
C:\Users\<userfolder>\AppData\Roaming\npm
C:\Program Files\nodejs


[1]:

[2]:
Reply

#7
make sure you have all these mentioned as part of path C:\Users<userfolder>\AppData\Roaming\npm\node_modules@angular\cli C:\Users<userfolder>\AppData\Roaming\npm C:\Program Files\nodejs

in my case, before npm install -g @angular/cli, the path of my system variable was:

C:\Users<userfolder>\AppData\Roaming\npm\node_modules@angular\cli\bin

I remove \bin and work!!!!!
Reply

#8
## Remember to fix this for the correct User ###

Associating .JS files to node.exe is the way to solve this.

**BUT** after struggling with the same issue, I wanted to add that the *file association* needs to be done with the same USER that you are working with the Terminal/Shell.

So if you use the Terminal as a Admin, you must login with your Admin Account just to fix the *file association*.

Cheers
Reply

#9
(2023 - Latest):
I got a similar Error.
Go to the file by copying that path
right click -> open with -> (by default its set to window script host) click(change)->select node (if u cant find node option)=> Install Node and open it by search an app in pc [reference img][1]
and open with the node

u can see the icons will change js file to node
now it will work fine!!

[1]:
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through