0

Nodejs version installed-8.12.0 npm version installed- 6.4.1

I was able to install angular CLI using "npm install -g @angular/cli" but when I try to create a project using "ng new myapp", I get the error below:

events.js:183 throw er; // Unhandled 'error' event

Error: spawn C:\Windows\system32\cmd.exe;E:\apache—maven-3.5.4\bin; ENOENT at Process.ChildProcess._handle_onexit (internal/child_process.js:190:19) at onErrorNT (internal/child_process.js:362:16) at _combinedTickCallback (internal/process/next_tick_js:139:11) at process._tickCallback (internal/process/next_tick_js:181:9)

9
  • 1
    Note: you can paste your error log directly in your question Commented Oct 1, 2018 at 16:23
  • Can you post the details around the Angular CLI version you have installed? You can see this via ng v in a command line Commented Oct 1, 2018 at 16:24
  • wondering what Maven does here... can you post the content of your PATH environment variable? Commented Oct 1, 2018 at 16:32
  • apache maven looks pretty weird. Commented Oct 1, 2018 at 17:38
  • @DanielWStrimpel Angular CLI verison is : 7.0.0-beta.4 Commented Oct 2, 2018 at 1:21

2 Answers 2

1

Your ComSpec environment variable is wrong, replace:

%SystemRoot%\system32\cmd.exe;E:\apache-maven-3.5.4\bin; 

With the following:

%SystemRoot%\system32\cmd.exe 

Then restart your cmd and retry to generate a project.

I have no idea why Maven got in there, it should not affect your Maven builds though.

Sign up to request clarification or add additional context in comments.

1 Comment

This solution worked for me in creating/setting up my React Native project on my local system.
0

These types of issues can happen due to proxy errors, typically behind a firewall. See https://github.com/angular/angular-cli/issues/11386

Do you have a mechanism to enter your proxy when running "npm install"?

Do note that in most instances where the process fails when installing the dependencies one can run "npm install" after the CLI finished configuring the new application.

1 Comment

I tried npm install after it failed to create project. But getting similar kind of error npm ERR! file C:\Windows\system32\cmd.exe;E:\apache-maven-3.5.4\bin; npm ERR! path C:\Windows\system32\cmd.exe;E:\apache-maven-3.5.4\bin; npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn C:\Windows\system32\cmd.exe;E:\apache-maven-3.5.4\bin; npm ERR! [email protected] postinstall: echo ''; echo cessor."; echo '' npm ERR! spawn C:\Windows\system32\cmd.exe;E:\apache-maven-3.5.4\bin; ENOENT npm ERR! npm ERR! Failed at the [email protected] postinstall script.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.