ng-cli error in Node js 7.x - node.js

I am using Windows 10.
I installed nodejs 7.4.0 using windows installer.
I installed typescript globally.
I installed ng-cli globally.
Then I went to command prompt into my new project folder and did "ng init".
It throws the following error.
events.js:154
throw er; // Unhandled 'error' event
^
Error: spawn sh ENOENT
at exports._errnoException (util.js:893:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:182:32)
at onErrorNT (internal/child_process.js:348:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Function.Module.runMain (module.js:449:11)
at startup (node.js:148:18)
at node.js:405:3
Any advise please ?

The problem was I should have installed "angular-cli" instead of "ng-cli".
This fixed my issue.

Related

Error spawning ngrok.exe while running an atlassian connect app

I am trying to create a atlassian connect app for Jira, and this is my first attempt at this. I have configured all the dependencies, including Python 2.7 and windows-production-tools required for it. I have generated an app and trying to run it using npm start, when I am facing the following issue:
Watching atlassian-connect.json for changes
App server running at http://IN-8BRM2J3:3000
node:events:505
throw er; // Unhandled 'error' event
^
Error: spawn ./ngrok.exe ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:478:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
at process.runNextTicks [as _tickCallback] (node:internal/process/task_queues:65:3)
at node:internal/main/run_main_module:17:47
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
I have already npm install ngrok and successfully configured the auth token using ngrok authtoken my-token.
Seems like node is not able to access the ngrok application. Can someone suggest me how to resolve this issue ?

Create-react-app: unhandled error event: Events.js.187

'm trying to create a new react app with yarn. after using the command create-react-app i keep getting an error unhandled events error. There's also a reference to django-admin.py in the error log for some reason and I can't make out the connection.Can i get some assistance. the log of the error is shown below
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
events.js:187
throw er; // Unhandled 'error' event
^
Error: spawn C:\Windows\system32\cmd.exe;C:\Users\HP\AppData\Local\Programs\Python\Python36\Scripts\django-admin.py ENOENT
[90m at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)[39m
[90m at onErrorNT (internal/child_process.js:456:16)[39m
[90m at processTicksAndRejections (internal/process/task_queues.js:80:21)[39m
Emitted 'error' event on ChildProcess instance at:
at ChildProcess.cp.emit (C:\Users\HP\AppData\Local\Yarn\Data\global\node_modules\[4mcross-spawn[24m\lib\enoent.js:34:29)
[90m at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)[39m
[90m at onErrorNT (internal/child_process.js:456:16)[39m
[90m at processTicksAndRejections (internal/process/task_queues.js:80:21)[39m {
errno: [32m'ENOENT'[39m,
code: [32m'ENOENT'[39m,
syscall: [32m'spawn C:\\Windows\\system32\\cmd.exe;C:\\Users\\HP\\AppData\\Local\\Programs\\Python\\Python36\\Scripts\\django-admin.py'[39m,
path: [32m'C:\\Windows\\system32\\cmd.exe;C:\\Users\\HP\\AppData\\Local\\Programs\\Python\\Python36\\Scripts\\django-admin.py'[39m,
spawnargs: [
[32m'/d'[39m,
[32m'/s'[39m,
[32m'/c'[39m,
[32m'"npm ^"install^" ^"--save^" ^"--save-exact^" ^"--loglevel^" ^"error^" ^"react^" ^"react-dom^" ^"react-scripts#0.9.x^""'[39m
]
}
C:\Users\HP\Documents\web dev\Angular 2>cd C:\Users\HP\Documents\web dev\Angular 2create-react-app my-app
Check that you have the following environment variables under PATH System Variables
C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
Mine were missing for some reason but when I added them in this exact same problem vanished.

Error: spawn cmd ENOENT in create-react-app

I installed nodejs and after then when I try to run my previous react app by running yarn start it gives me an error something like this.
Even if I make a new app with create-react-app it gives the same error while trying to start.
nodejs apps are working fine so I think the problem is with create-react-app. I don't know how to fix them.
$ react-scripts start
Starting the development server...
events.js:174
throw er; // Unhandled 'error' event
^
Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
And I have no idea what is wrong. Please help me fix this.
Change react-scripts version in package.json to 2.1.8. It works for me.

nodemon app.js throws error spawn C:\Program Files\nodejs\node.exe ENOENT

I am getting the below error whenever I run nodemon app.js. I have Node.js 7.4.0 and npm 4.1.2 already installed globally and nodemon 6.7.0 as well. If I run my application using command "node" it works fine but if I use command "nodemon" it throws this error.
I tried to uninstall and re-install nodemon but wtih no difference.
The path for npm has been already added to system variables and "C:\Windows\System32" has been added to both user and system variables.
Any kind of help is highly appreciated.
events.js:160
throw er; // Unhandled 'error' event
^
Error: spawn C:\Program Files\nodejs\node.exe ENOENT
at exports._errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Module.runMain (module.js:607:11)
at run (bootstrap_node.js:420:7)
at startup (bootstrap_node.js:139:9)
at bootstrap_node.js:535:3

Yeoman - Gulp spawn cmd enoent

With the help gulp yeoman-webapp 'im wolf. But it also serves on the command line, I get the following error gulp. Can you help me? Thank you in advance.
I work in Windows 10 and 64 bit computing.
events.js:85
throw er; // Unhandled 'error' event
^
Error: spawn cmd ENOENT
at exports._errnoException (util.js:746:11)
at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
at child_process.js:1144:20
at process._tickCallback (node.js:355:11)
Try to put in your system variables in the PATH :
C:\Windows\System32;

Resources