Can't launch nodejs + express basic program - node.js

I am having a bit of trouble with a basic nodejs and express program.
The problem is when I use npm start which should run node .\bin\www I get these errors:
C:\Users\{USRNAME}\Desktop\projets\cdc\cdc-api>npm start
cdc-api#0.0.0 start C:\Users\{USRNAME}\Desktop\projets\cdc\cdc-api
node .\bin\www
events.js:72
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE
at errnoException (net.js:904:11)
at Server._listen2 (net.js:1042:14)
at listen (net.js:1064:10)
at Server.listen (net.js:1138:5)
at Function.app.listen (C:\Users\{USRNAME}\Desktop\projets\cdc\cdc-api\node_mo
dules\express\lib\application.js:556:24)
at Object.<anonymous> (C:\Users\{USRNAME}\Desktop\projets\cdc\cdc-api\bin\www:
7:18)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
npm ERR! cdc-api#0.0.0 start: `node .\bin\www`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the cdc-api#0.0.0 start script.
npm ERR! This is most likely a problem with the cdc-api package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node .\bin\www
npm ERR! You can get their info via:
npm ERR! npm owner ls cdc-api
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! cwd C:\Users\{USRNAME}\Desktop\projets\cdc\cdc-api
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\{USRNAME}\Desktop\projets\cdc\cdc-api\npm-debug.log
npm ERR! not ok code 0
C:\Users\{USRNAME}\Desktop\projets\cdc\cdc-api>
and here is what I have in npm-debug.log:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start' ]
2 info using npm#1.4.28
3 info using node#v0.10.32
4 verbose node symlink C:\Program Files\nodejs\\node.exe
5 verbose run-script [ 'prestart', 'start', 'poststart' ]
6 info prestart cdc-api#0.0.0
7 info start cdc-api#0.0.0
8 verbose unsafe-perm in lifecycle true
9 info cdc-api#0.0.0 Failed to exec start script
10 error cdc-api#0.0.0 start: `node .\bin\www`
10 error Exit status 8
11 error Failed at the cdc-api#0.0.0 start script.
11 error This is most likely a problem with the cdc-api package,
11 error not with npm itself.
11 error Tell the author that this fails on your system:
11 error node .\bin\www
11 error You can get their info via:
11 error npm owner ls cdc-api
11 error There is likely additional logging output above.
12 error System Windows_NT 6.2.9200
13 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
14 error cwd C:\Users\Moucheg\Desktop\projets\cdc\cdc-api
15 error node -v v0.10.32
16 error npm -v 1.4.28
17 error code ELIFECYCLE
18 verbose exit [ 1, true ]
I have tried everything I found on internet (reinstall node, recreate package.json, ...) I can't get it to work.
FYI, I am on Windows 8 (if it's of any help)
Thank you in advance for your help guys (and girls ;)).

The error "EADDRINUSE" means the port you're attempting to use is already in use by your system. Try changing the port used in your app or closing whatever program is using it.

The error means that the port is currently in use.
Update the code to use a different port. Often times, node.js/express samples assign the port in app.js.

EADDRINUSE happens when your code is using the same port of another program.
You can try to use another port to see if the problem is resolved.

Related

Symfony 5.2 + Webpack Encore: npm run shows error 'Unexpected token'

I have setup a new Symfony 5.2 project and added Webpack Encore on a shared Server with no root access.
Yarn is not available on this machine, so I used npm:
// setup new Symfony 5.2 project
symfony new sym5 --version=5.2 --full
...
cd sym5
// add Webpack Encore
composer require symfony/webpack-encore-bundle
npm install
...
// try to compile assets
npm run dev
I have made no changes to the webpack.config.js and asset/ files which have been automatically created. Running npm run dev leads to an Unexpected token error:
npm run dev
> # dev /customers/123/webpages/sym5
> encore dev
/customers/123/webpages/sym5/node_modules/pkg-up/index.js:4
module.exports = async ({cwd} = {}) => findUp('package.json', {cwd});
^
SyntaxError: Unexpected token (
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/customers/123/webpages/sym5/node_modules/#symfony/webpack-encore/lib/config/parse-runtime.js:13:15)
npm ERR! Linux 3.18.117-pvops-xen-x64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "dev"
npm ERR! node v6.11.3
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! # dev: `encore dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # dev script 'encore dev'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! encore dev
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /customers/123/webpages/sym5/npm-debug.log
Since the error is not reported in any my custom files, I assume that this is a problem of Node.js / Webpack itself? Is this correct?
The message says, that one should use the latest versions of node.js and npm. The versions available on the server (node v6.11.3 and npm v3.10.10) are indeed quite old but without root access I cannot change this, can I?
However, since the adding / installing Webpack Encore using these node.js and npm version worked without any problem, I wonder if using these old version is really the cause of the problem.
Is there anything I can do to find the actual cause and to solve the problem?
// /customers/123/webpages/sym5/npm-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'dev' ]
2 info using npm#3.10.10
3 info using node#v6.11.3
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle #~predev: #
6 silly lifecycle #~predev: no script for predev, continuing
7 info lifecycle #~dev: #
8 verbose lifecycle #~dev: unsafe-perm in lifecycle true
9 verbose lifecycle #~dev: PATH: /usr/lib/node_modules/npm/bin/node-gyp-bin:/customers/123/webpages/sym5/node_modules/.bin:/customers/123/bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/customers/123/.gem/bin
10 verbose lifecycle #~dev: CWD: /customers/123/webpages/sym5
11 silly lifecycle #~dev: Args: [ '-c', 'encore dev' ]
12 silly lifecycle #~dev: Returned: code: 1 signal: null
13 info lifecycle #~dev: Failed to exec dev script
14 verbose stack Error: # dev: `encore dev`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/lib/utils/lifecycle.js:255:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:191:7)
14 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:191:7)
14 verbose stack at maybeClose (internal/child_process.js:920:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
15 verbose pkgid #
16 verbose cwd /customers/123/webpages/sym5
17 error Linux 3.18.117-pvops-xen-x64
18 error argv "/usr/bin/node" "/usr/bin/npm" "run" "dev"
19 error node v6.11.3
20 error npm v3.10.10
21 error code ELIFECYCLE
22 error # dev: `encore dev`
22 error Exit status 1
23 error Failed at the # dev script 'encore dev'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error encore dev
23 error You can get information on how to open an issue for this project with:
23 error npm bugs
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

Why is Windows 10 attempting to find this node module from Apache Zeppelin in C:/ instead of the local directory?

I am using Apache Zeppelin 0.8.0 to create some software for data visualization. Specifically, I am using the Helium plugin system that Zeppelin provides to create some sharp charts and graphs from High Charts. Using Linux and Mac, I have had no issues getting the visualizations to run-- including the advanced visualizations provided by zeppelin, but they do not work on windows 10 properly. You can test it by downloading the binary package provided by zeppelin on their home page, install it, run it and then go to the Helium area in the menu-- you will notice the advanced visualizations do not appear (windows 10).
The main issue is with nodejs-- it is trying to find the node module for a package at C:\ instead of the directory where it is being run from-- here is the output:
Running 'npm run bundle --registry=http://registry.npmjs.org/' in C:\Users\Pablo\Desktop\zeppelin-0.8.0-SNAPSHOT\local-repo\helium-bundle
> zeppelin-helium-bundle# bundle C:\Users\Pablo\Desktop\zeppelin-0.8.0-SNAPSHOT\local-repo\helium-bundle
> node/node node_modules/webpack/bin/webpack.js --display-error-details --json
module.js:471
throw err;
^
Error: Cannot find module 'C:\node'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Users\\Pablo\\Desktop\\zeppelin-0.8.0-SNAPSHOT\\local-repo\\helium-bundle\\node\\node.exe" "C:\\Users\\Pablo\\Desktop\\zeppelin-0.8.0-SNAPSHOT\\local-repo\\helium-bundle\\node\\node_modules\\npm\\bin\\npm-cli.js" "run" "bundle" "--registry=http://registry.npmjs.org/"
npm ERR! node v6.9.1
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! zeppelin-helium-bundle# bundle: `node/node node_modules/webpack/bin/webpack.js --display-error-details --json`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the zeppelin-helium-bundle# bundle script 'node/node node_modules/webpack/bin/webpack.js --display-error-details --json'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the zeppelin-helium-bundle package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node/node node_modules/webpack/bin/webpack.js --display-error-details --json
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs zeppelin-helium-bundle
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls zeppelin-helium-bundle
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Pablo\Desktop\zeppelin-0.8.0-SNAPSHOT\local-repo\helium-bundle\npm-debug.log
And here is the npm-debug.log file:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Users\\Pablo\\Desktop\\zeppelin-0.8.0-SNAPSHOT\\local-repo\\helium-bundle\\node\\node.exe',
1 verbose cli 'C:\\Users\\Pablo\\Desktop\\zeppelin-0.8.0-SNAPSHOT\\local-repo\\helium-bundle\\node\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'bundle',
1 verbose cli '--registry=http://registry.npmjs.org/' ]
2 info using npm#3.10.8
3 info using node#v6.9.1
4 verbose run-script [ 'prebundle', 'bundle', 'postbundle' ]
5 info lifecycle zeppelin-helium-bundle#~prebundle: zeppelin-helium-bundle#
6 silly lifecycle zeppelin-helium-bundle#~prebundle: no script for prebundle, continuing
7 info lifecycle zeppelin-helium-bundle#~bundle: zeppelin-helium-bundle#
8 verbose lifecycle zeppelin-helium-bundle#~bundle: unsafe-perm in lifecycle true
9 verbose lifecycle zeppelin-helium-bundle#~bundle: PATH: C:\Users\Pablo\Desktop\zeppelin-0.8.0-SNAPSHOT\local-repo\helium-bundle\node\node_modules\npm\bin\node-gyp-bin;C:\Users\Pablo\Desktop\zeppelin-0.8.0-SNAPSHOT\local-repo\helium-bundle\node_modules\.bin;C:\Users\Pablo\Desktop\zeppelin-0.8.0-SNAPSHOT\local-repo\helium-bundle\node;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Git\cmd;C:\Program Files (x86)\scala\bin;C:\Users\Pablo\AppData\Roaming\npm;C:\nodejs;C:\Users\Pablo\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Heroku\bin;C:\Users\Pablo\AppData\Roaming\npm;C:\nodejs;
10 verbose lifecycle zeppelin-helium-bundle#~bundle: CWD: C:\Users\Pablo\Desktop\zeppelin-0.8.0-SNAPSHOT\local-repo\helium-bundle
11 silly lifecycle zeppelin-helium-bundle#~bundle: Args: [ '/d /s /c',
11 silly lifecycle 'node/node node_modules/webpack/bin/webpack.js --display-error-details --json' ]
12 silly lifecycle zeppelin-helium-bundle#~bundle: Returned: code: 1 signal: null
13 info lifecycle zeppelin-helium-bundle#~bundle: Failed to exec bundle script
14 verbose stack Error: zeppelin-helium-bundle# bundle: `node/node node_modules/webpack/bin/webpack.js --display-error-details --json`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (C:\Users\Pablo\Desktop\zeppelin-0.8.0-SNAPSHOT\local-repo\helium-bundle\node\node_modules\npm\lib\utils\lifecycle.js:255:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:191:7)
14 verbose stack at ChildProcess.<anonymous> (C:\Users\Pablo\Desktop\zeppelin-0.8.0-SNAPSHOT\local-repo\helium-bundle\node\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:191:7)
14 verbose stack at maybeClose (internal/child_process.js:877:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid zeppelin-helium-bundle#
16 verbose cwd C:\Users\Pablo\Desktop\zeppelin-0.8.0-SNAPSHOT\local-repo\helium-bundle
17 error Windows_NT 10.0.14393
18 error argv "C:\\Users\\Pablo\\Desktop\\zeppelin-0.8.0-SNAPSHOT\\local-repo\\helium-bundle\\node\\node.exe" "C:\\Users\\Pablo\\Desktop\\zeppelin-0.8.0-SNAPSHOT\\local-repo\\helium-bundle\\node\\node_modules\\npm\\bin\\npm-cli.js" "run" "bundle" "--registry=http://registry.npmjs.org/"
19 error node v6.9.1
20 error npm v3.10.8
21 error code ELIFECYCLE
22 error zeppelin-helium-bundle# bundle: `node/node node_modules/webpack/bin/webpack.js --display-error-details --json`
22 error Exit status 1
23 error Failed at the zeppelin-helium-bundle# bundle script 'node/node node_modules/webpack/bin/webpack.js --display-error-details --json'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the zeppelin-helium-bundle package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error node/node node_modules/webpack/bin/webpack.js --display-error-details --json
23 error You can get information on how to open an issue for this project with:
23 error npm bugs zeppelin-helium-bundle
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls zeppelin-helium-bundle
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
I have searched extensively and have attempted reinstalling nodejs on my current system, as well as updating environmental variables. Currently, my theory is that there is an Autorun string somewhere on my machine that is causing it to automatically run/search for this package in C:/, but it is a wild theory. Any help would be greatly appreciated. Here is a screenshot of my zeppelin helium package page:
Helium - Zeppelin Windows 10 Issues

prerender charts with dc with node.js

I am trying to prerender charts with dc.js using npm
but when i include dc in my code it throws error, I am a nwebie in node.js, Tried searching for answers no luck, may be it should be a version error i learnt that jsdom version > 1 has no createWindow(); methord but changing version and calling npm install and update dint work either.. Any Help is much appriciated, thanks in advance
my package.json
{
"name": "binode",
"version": "1.0.0",
"description": "binode testing",
"main": "index.js",
"scripts": {
"start": "node index"
},
"author": "abc",
"license": "MIT",
"dependencies": {
"body-parser": "^1.13.3",
"d3": "^3.5.6",
"dc": "^1.7.3",
"express": "^4.13.3",
"jsdom": "^1.5.0"
}
}
Error :
/learn/nodeSample/biNode/node_modules/dc/globals.js:2
window = global.window = document.createWindow();
^
TypeError: undefined is not a function
at Object.<anonymous> (/Volumes/Official/learn/nodeSample/biNode/node_modules/dc/globals.js:2:39)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/Volumes/Official/learn/nodeSample/biNode/node_modules/dc/index.js:8:1)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
npm ERR! Darwin 14.5.0
npm ERR! argv "node" "/usr/local/bin/npm" "start"
npm ERR! node v0.12.7
npm ERR! npm v2.14.1
npm ERR! code ELIFECYCLE
npm ERR! binode#1.0.0 start: `node index`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the binode#1.0.0 start script 'node index'.
npm ERR! This is most likely a problem with the binode package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node index
npm ERR! You can get their info via:
npm ERR! npm owner ls binode
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Volumes/Official/learn/nodeSample/biNode/npm-debug.log
npm-debug.log :
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'start' ]
2 info using npm#2.14.1
3 info using node#v0.12.7
4 verbose node symlink /usr/local/bin/node
5 verbose run-script [ 'prestart', 'start', 'poststart' ]
6 info prestart binode#1.0.0
7 info start binode#1.0.0
8 verbose unsafe-perm in lifecycle true
9 info binode#1.0.0 Failed to exec start script
10 verbose stack Error: binode#1.0.0 start: `node index`
10 verbose stack Exit status 1
10 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:214:16)
10 verbose stack at EventEmitter.emit (events.js:110:17)
10 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14)
10 verbose stack at ChildProcess.emit (events.js:110:17)
10 verbose stack at maybeClose (child_process.js:1015:16)
10 verbose stack at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
11 verbose pkgid binode#1.0.0
12 verbose cwd /Volumes/Official/learn/nodeSample/biNode
13 error Darwin 14.5.0
14 error argv "node" "/usr/local/bin/npm" "start"
15 error node v0.12.7
16 error npm v2.14.1
17 error code ELIFECYCLE
18 error binode#1.0.0 start: `node index`
18 error Exit status 1
19 error Failed at the binode#1.0.0 start script 'node index'.
19 error This is most likely a problem with the binode package,
19 error not with npm itself.
19 error Tell the author that this fails on your system:
19 error node index
19 error You can get their info via:
19 error npm owner ls binode
19 error There is likely additional logging output above.
20 verbose exit [ 1, true ]
my simple js file:
var express = require('express');
var app = express();
var d3 = require('d3');
var dc = require('dc');
var crossfilter = require('crossfiler');
var jsdom = require('jsdom');
global.d3 = d3;
var port = 2000;
app.listen(port,function(){
console.log("app listing port "+port)
});
i was just getting started at the beginning itself it threw error
I tried running npm install inside node_modules/dc
Then there was one more issue index.js no dc is defined added
changed require('./dc') to dc =require('./dc')
Now its working..

npm install fails with "Cannot find module 'glob'"

Here is the output on the console:
floydpink#MBP mean-app (master) $ npm install
npm ERR! Darwin 13.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.10.32
npm ERR! npm v2.0.0
npm ERR! code MODULE_NOT_FOUND
npm ERR! Cannot find module 'glob'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /Users/floydpink/Source/swara-server/mean-app/npm-debug.log
floydpink#MBP mean-app (master) $
And the npm-debug.log:
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'install' ]
2 info using npm#2.0.0
3 info using node#v0.10.32
4 verbose node symlink /usr/local/bin/node
5 verbose stack Error: Cannot find module 'glob'
5 verbose stack at Function.Module._resolveFilename (module.js:338:15)
5 verbose stack at Function.Module._load (module.js:280:25)
5 verbose stack at Module.require (module.js:364:17)
5 verbose stack at require (module.js:380:17)
5 verbose stack at Object.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/completion/file-completion.js:5:12)
5 verbose stack at Module._compile (module.js:456:26)
5 verbose stack at Object.Module._extensions..js (module.js:474:10)
5 verbose stack at Module.load (module.js:356:32)
5 verbose stack at Function.Module._load (module.js:312:12)
5 verbose stack at Module.require (module.js:364:17)
6 verbose cwd /Users/floydpink/Source/swara-server/mean-app
7 error Darwin 13.4.0
8 error argv "node" "/usr/local/bin/npm" "install"
9 error node v0.10.32
10 error npm v2.0.0
11 error code MODULE_NOT_FOUND
12 error Cannot find module 'glob'
13 error If you need help, you may report this error at:
13 error <http://github.com/npm/npm/issues>
14 verbose exit [ 1, true ]
I upgraded to this version of nodejs and npm a few days back and things have been fine until yesterday.
Could someone point me to the right direction in fixing this?
I faced the exact issue. But I did not have brew on my Ubuntu Amazon EC2 instance(and I did not want to install it). I uninstalled npm using sudo npm uninstall npm –g and then ran the make install command again in the NPM directory to recompile npm and that fixed the issue.
In my case, my Node.js was installed by the .pkg file(On a macOS). And tried reinstall npm but failed.
I solved this problem by uninstall the node totally follow this gist: https://gist.github.com/TonyMtz/d75101d9bdf764c890ef

npm start gives the error that server.js is not a valid win32 application

I'm trying to start the application server for a group project I'm doing. I posted my error below and I'll copy the npm-debug.log contents below.
This works perfectly fine my teammates mac laptop. I'm trying to run this on a Windows 8 64 bit machine. I tried with both the 32 bit and 64 bit binaries of node and it gives the same output.
output from npm start
Windows PowerShell Copyright (C) 2013 Microsoft Corporation. All
rights reserved.
C:\Users\damien\Documents\GitHub\lend [development]> npm start
lending-app#0.0.1 start C:\Users\damien\Documents\GitHub\lend
brunch watch --server
05 Apr 22:01:49 - error: couldn't load server lend.js: Error: %1 is
not a valid Win32 application.
C:\Users\damien\Documents\GitHub\lend\node_modules\client-sessions\node_modules\node-proxy\build\Release\nodeproxy.node
C:\Users\damien\AppData\Roaming\npm\node_modules\brunch\lib\watch.js:105
if (server.startServer == null) {
^ TypeError: Cannot read property 'startServer' of undefined
at startServer (C:\Users\damien\AppData\Roaming\npm\node_modules\brunch\lib\watch.js:105:17)
at C:\Users\damien\AppData\Roaming\npm\node_modules\brunch\lib\watch.js:418:18
at C:\Users\damien\AppData\Roaming\npm\node_modules\brunch\lib\helpers.js:475:14
at C:\Users\damien\AppData\Roaming\npm\node_modules\brunch\node_modules\read-components\index.js:207:16
at C:\Users\damien\AppData\Roaming\npm\node_modules\brunch\node_modules\read-components\index.js:34:14
at Object.cb [as oncomplete] (fs.js:168:19)
npm ERR! lending-app#0.0.1 start: brunch watch --server npm ERR!
Exit status 8 npm ERR! npm ERR! Failed at the lending-app#0.0.1 start
script. npm ERR! This is most likely a problem with the lending-app
package, npm ERR! not with npm itself. npm ERR! Tell the author that
this fails on your system: npm ERR! brunch watch --server npm ERR!
You can get their info via: npm ERR! npm owner ls lending-app npm
ERR! There is likely additional logging output above. npm ERR! System
Windows_NT 6.2.9200 npm ERR! command "C:\Program
Files\nodejs\\node.exe" "C:\Program
Files\nodejs\node_modules\npm\bin\npm-cli.js" "start" npm ERR!
cwd C:\Users\damien\Documents\GitHub\lend npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3 npm ERR! code ELIFECYCLE npm ERR! npm ERR!
Additional logging details can be found in: npm ERR!
C:\Users\damien\Documents\GitHub\lend\npm-debug.log npm ERR! not ok
code 0 C:\Users\damien\Documents\GitHub\lend [development]>
npm-debug.log
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\\node.exe',
1 verbose cli 'C:\Program
Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'start' ]
2 info using npm#1.4.3
3 info using node#v0.10.26
4 verbose node symlink C:\Program Files\nodejs\node.exe
5 verbose run-script [ 'prestart', 'start', 'poststart' ]
6 info prestart lending-app#0.0.1
7 info start lending-app#0.0.1
8 verbose unsafe-perm in lifecycle true
9 info lending-app#0.0.1 Failed to exec start script
10 error lending-app#0.0.1 start: brunch watch --server
10 error Exit status 8
11 error Failed at the lending-app#0.0.1 start script.
11 error This is most likely a problem with the lending-app package,
11 error not with npm itself.
11 error Tell the author that this fails on your system:
11 error brunch watch --server
11 error You can get their info via:
11 error npm owner ls lending-app
11 error There is likely additional logging output above.
12 error System Windows_NT 6.2.9200
13 error command "C:\Program Files\nodejs\\node.exe" "C:\Program
Files\nodejs\node_modules\npm\bin\npm-cli.js" "start"
14 error cwd C:\Users\damien\Documents\GitHub\lend
15 error node -v v0.10.26
16 error npm -v 1.4.3
17 error code ELIFECYCLE
18 verbose exit [ 1, true ]
npm start calls the scripts.start entry in your package.json file. In this case it looks like the command is brunch watch --server. Chances are you are missing the brunch binary which is causing npm to spit out the error.

Resources