49527

Node js - Error: spawn ENOENT (Windows 8.1)

Question:

I'm using nodejs version - v0.10.31

On one machine it does work, and on my machine it doesn't. Can someone give me some advice where I can start searching for a problem ?

var express = require('express'), path = require('path'), fs = require('fs'), mongoose = require('mongoose'), expressSession = require("express-session"); var env = process.env.NODE_ENV = process.env.NODE_ENV || "development"; var config = require('./server/config/config')[env]; var app = express(); var server = app.listen(config.port); var sessionMiddleware = expressSession({ name: "dga-cookie", secret: "dga-secret", store: new (require("connect-mongo")(expressSession))({ url: config.db, auto_reconnect: true }), saveUninitialized: true, resave: true }); app.use(sessionMiddleware); var io = require('socket.io')(server); io.use(function(socket, next){ sessionMiddleware(socket.request, {}, next); }); require('./server/config/express')(app, config); require('./server/config/mongoose')(config); /* user schema */ var userSchema = mongoose.Schema({ username: {type: String, required: true, unique: true}, email: {type: String, required: true, unique: true}, password: {type: String, required: true}, activated: {type: Boolean, required: true} }); var User = mongoose.model('users', userSchema); require('./server/config/routes')(app); require('./server/config/rest/user')(app, io, User); require('./server/config/rest/game')(app, io, User);

and there is the package.json:

{ "name": "app", "version": "0.0.1", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { "type": "git", "url": "https://github.com/..." }, "author": "", "license": "ISC", "bugs": { "url": "https://github.com/..." }, "homepage": "https://github.com/...", "dependencies": { "body-parser": "~1.5.0", "compass": "~0.1.0", "connect-mongo": "~0.4.1", "cookie-parser": "~1.3.2", "express": "~4.6.1", "express-session": "~1.7.0", "jade": "~1.4.2", "mongoose": "~3.8.13", "morgan": "~1.2.0", "node-compass": "^0.2.3", "passport": "~0.2.0", "passport-local": "~1.0.0", "sha1": "^1.1.0" }, "devDependencies": { "bower": "~1.3.8", "socket.io": "~1.0.6" } } $ nodemon server 15 Sep 20:51:36 - [nodemon] v1.2.1 15 Sep 20:51:36 - [nodemon] to restart at any time, enter `rs` 15 Sep 20:51:36 - [nodemon] watching: *.* 15 Sep 20:51:36 - [nodemon] starting `node server` DGE db opened GET / 304 626.838 ms - - events.js:72 throw er; // Unhandled 'error' event ^ Error: spawn ENOENT at errnoException (child_process.js:1001:11) at Process.ChildProcess._handle.onexit (child_process.js:792:34) 15 Sep 20:51:45 - [nodemon] app crashed - waiting for file changes before starting...

Answer1:

I also got the same error on Windows 8.1. The error is because of an environment variable of your system path missing "C:\Windows\System32\" value. So go to My Computer right click, go to the Properties->Advanced System Setting->Environment variable. Now open(Edit) "PATH" variable and add "C:\Windows\System32\" value into the value filed of the path variable. Save all changes. Now close your Node.js cmd prompt and reopen it. Now type nodemon cmd. Hope it will work for you.

Answer2:

This is happening after a GET request. I'd look into your routing file and see what files are being used within that context.

Answer3:

i suggest you check if mongodb is installed on the machine (the executable, not the npm). this error often occurs when node tries to execute a program that does not exist.

good luck!

Recommend

  • why route of backbone needs the default route
  • Is it expensive to create the Thread object or to actually start the thread?
  • Python 3 Sorting a List of Tuples?
  • Manage different base layouts in Angular2
  • Different builds of turn-based Game Center game can’t see each other’s matches
  • update record in database using jdatabase
  • opengl window freezing during move/resize
  • React Router and Arbitrary Query Params: Page Refreshes Unintentionally on Load?
  • PWA with multiple pages
  • How to resolve this packager error on react native Android
  • Installing PHP 7 on digitalocean
  • where do I find the xml.dom python package for the python-2.6.0-8.9.28 and I have a suse/x86_64 vers
  • Spring boot 2.0.0.M4 required a bean named 'entityManagerFactory' that could not be found
  • Read text file that is not in the main package in a runnable jar
  • Authentication in Play! and RestEasy
  • Roxygen error “Skipping invalid path”
  • Problems installing Yesod for Haskell
  • How can the INSERT … ON CONFLICT (id) DO UPDATE… syntax be used with a sequence ID?
  • jQuery ready not fired after rails link_to is clicked
  • QLPreviewController hide print button in ios6
  • Mysterious problem with floating point in LISP - time axis generation
  • Bad request using file_get_contents for PUT request in PHP
  • Uncaught Error: Could not find module `ember-load-initializers`
  • How to make a tree having multiple type of nodes and each node can have multiple child nodes in java
  • output of program is not same as passed argument
  • Cassandra Data Model
  • Akka Routing: Reply's send to router ends up as dead letters
  • Matrix multiplication with MKL
  • Codeigniter doesn't let me update entry, because some fields must be unique
  • Authorize attributes not working in MVC 4
  • unknown Exception android
  • MATLAB: Piecewise function in curve fitting toolbox using fittype
  • Checking variable from a different class in C#
  • Busy indicator not showing up in wpf window [duplicate]
  • How to get NHibernate ISession to cache entity not retrieved by primary key
  • Why is Django giving me: 'first_name' is an invalid keyword argument for this function?
  • Binding checkboxes to object values in AngularJs
  • How can I use `wmic` in a Windows PE script?
  • Python/Django TangoWithDjango Models and Databases
  • Net Present Value in Excel for Grouped Recurring CF