Edit: I changed the title for this question because it seemed more accurate.
So this is my package.json file:
{
"name": "application-name",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node ./bin/www"
},
"dependencies": {
"express": "~4.0.0",
"static-favicon": "~1.0.0",
"morgan": "~1.0.0",
"cookie-parser": "~1.0.1",
"body-parser": "~1.0.0",
"debug": "~0.7.4",
"jade": "~1.3.0",
"mongodb": "*",
"monk": "*"
}
}
I don't really get an error after hitting npm install but it seems like node didn't install all dependencies. Because when we hit the exact same code on my collegue's pc his promt said a lot more feedback on installed dependencies and it worked fine there.
When i now hit "npm start" it just terminates after a few seconds without any response.
I know there is a bug with node at the moment and i already tried to clear my npm chache and adding the "npm update" command and it still doesn't work.
It seems like its a problem with my pc because, like i said, on my collegue's pc everything worked fine. I hope you have any ideas what could be the problem. Thanks a lot in advance!
Edit: Here's what the npm list command gives me:
├─┬ body-parser#1.0.2
│ ├── qs#0.6.6
│ ├─┬ raw-body#1.1.3
│ │ └── bytes#0.2.1
│ └─┬ type-is#1.1.0
│ └── mime#1.2.11
├─┬ cookie-parser#1.0.1
│ ├── cookie#0.1.0
│ └── cookie-signature#1.0.3
├── debug#0.7.4
├─┬ express#4.0.0
│ ├─┬ accepts#1.0.0
│ │ ├── mime#1.2.11
│ │ └── negotiator#0.3.0
│ ├── buffer-crc32#0.2.1
│ ├── cookie#0.1.0
│ ├── cookie-signature#1.0.3
│ ├── debug#0.8.0
│ ├── escape-html#1.0.1
│ ├── fresh#0.2.2
│ ├── merge-descriptors#0.0.2
│ ├── methods#0.1.0
│ ├── parseurl#1.0.1
│ ├── path-to-regexp#0.1.2
│ ├── qs#0.6.6
│ ├── range-parser#1.0.0
│ ├─┬ send#0.2.0
│ │ ├── debug#0.8.0
│ │ └── mime#1.2.11
│ ├─┬ serve-static#1.0.1
│ │ └─┬ send#0.1.4
│ │ ├── debug#0.8.0
│ │ ├── fresh#0.2.0
│ │ ├── mime#1.2.11
│ │ └── range-parser#0.0.4
│ ├─┬ type-is#1.0.0
│ │ └── mime#1.2.11
│ └── utils-merge#1.0.0
├─┬ jade#1.3.1
│ ├── character-parser#1.2.0
│ ├── commander#2.1.0
│ ├─┬ constantinople#2.0.0
│ │ └─┬ uglify-js#2.4.13
│ │ ├── async#0.2.10
│ │ ├─┬ optimist#0.3.7
│ │ │ └── wordwrap#0.0.2
│ │ ├─┬ source-map#0.1.33
│ │ │ └── amdefine#0.1.0
│ │ └── uglify-to-browserify#1.0.2
│ ├── mkdirp#0.3.5
│ ├─┬ monocle#1.1.51
│ │ └─┬ readdirp#0.2.5
│ │ └─┬ minimatch#0.2.14
│ │ ├── lru-cache#2.5.0
│ │ └── sigmund#1.0.0
│ ├─┬ transformers#2.1.0
│ │ ├─┬ css#1.0.8
│ │ │ ├── css-parse#1.0.4
│ │ │ └── css-stringify#1.0.5
│ │ ├─┬ promise#2.0.0
│ │ │ └── is-promise#1.0.0
│ │ └─┬ uglify-js#2.2.5
│ │ ├─┬ optimist#0.3.7
│ │ │ └── wordwrap#0.0.2
│ │ └─┬ source-map#0.1.33
│ │ └── amdefine#0.1.0
│ └─┬ with#3.0.0
│ └─┬ uglify-js#2.4.13
│ ├── async#0.2.10
│ ├─┬ optimist#0.3.7
│ │ └── wordwrap#0.0.2
│ ├─┬ source-map#0.1.33
│ │ └── amdefine#0.1.0
│ └── uglify-to-browserify#1.0.2
├─┬ mongodb#1.4.0
│ ├─┬ bson#0.2.7
│ │ └── nan#0.8.0
│ └── kerberos#0.0.3
├─┬ monk#0.8.1
│ ├── debug#0.8.0
│ ├─┬ mongoskin#0.4.4
│ │ └─┬ mongodb#1.1.11
│ │ └── bson#0.1.5
│ └── mpromise#0.4.4
├─┬ morgan#1.0.0
│ └── bytes#0.2.1
└── static-favicon#1.0.2
So it really looks like the dependencies have been installed (if I'm not completely wrong?). Still my "npm start" command terminates after just a few seconds... any guesses?
If you cleared the npm cache, try also removing all folders in your app's node_modules and run npm install again.
You might want to try starting your app in DEBUG mode and see if it gives you any hint:
DEBUG=express:* node ./bin/www
if the cursor is returning on node app.js(server.js or whatever the name of the js is) like shown below
c:/users/<project-path>:node app.js
c:/users/<project-path>:
Then you might be using express 4 generator
So try the following command
set DEBUG=<project-folder-name>:* & npm start
Not sure if this is resolved or ignored and found a workaround. Just had gone through the problem myself and found out that the problem was not with NodeJS but with one of the dependencies. I failed to install ejs and all my files are ejs based. So I got the same error as you.
So it is best to check if all your dependencies are installed properly.
Related
I've been attempting to install the twilio sms marketing example app (https://github.com/TwilioDevEd/marketing-notifications-node/tree/master) . I've installed mongodb and mongo and have been able to run them without any problems. The problems occur when I try to run the node . command. I receive throw errors. Here is the error I receive when I try to use node . in the project directory.
MacBook-Pro:marketing-notifications-node-master user$ node .
module.js:471
throw err;
^
Error: Cannot find module 'mongodb/node_modules/bson'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/$USER/Desktop/marketing-notifications-node-master/node_modules/mongoose/lib/drivers/node-mongodb-native/objectid.js:8:52)
at Module._compile (module.js:570:32)
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)
MacBook-Pro:marketing-notifications-node-master $USER$
I really need help to figure this out.
I've tried
npm cache clean
npm install -g npm#latest
npm install
npm install
output:
/Users/$USER/.npm-packages/bin/npm -> /Users/$USER/.npm-packages/lib/node_modules/npm/bin/npm-cli.js
/Users/$USER/.npm-packages/lib
└─┬ npm#4.3.0
├── abbrev#1.0.9
├── ansi-regex#2.1.1
├── ansicolors#0.3.2
├── ansistyles#0.1.3
├── aproba#1.1.1
├── archy#1.0.0
├── asap#2.0.5
├── chownr#1.0.1
├── cmd-shim#2.0.2
├─┬ columnify#1.5.4
│ └─┬ wcwidth#1.0.0
│ └─┬ defaults#1.0.3
│ └── clone#1.0.2
├─┬ config-chain#1.1.11
│ └── proto-list#1.2.4
├── debuglog#1.0.1
├── dezalgo#1.0.3
├── editor#1.0.0
├── fs-vacuum#1.2.9
├── fs-write-stream-atomic#1.0.8
├── fstream#1.0.10
├─┬ fstream-npm#1.2.0
│ └─┬ fstream-ignore#1.0.5
│ └─┬ minimatch#3.0.3
│ └─┬ brace-expansion#1.1.6
│ ├── balanced-match#0.4.2
│ └── concat-map#0.0.1
├─┬ glob#7.1.1
│ ├── fs.realpath#1.0.0
│ ├─┬ minimatch#3.0.3
│ │ └─┬ brace-expansion#1.1.6
│ │ ├── balanced-match#0.4.2
│ │ └── concat-map#0.0.1
│ └── path-is-absolute#1.0.1
├── graceful-fs#4.1.11
├── has-unicode#2.0.1
├── hosted-git-info#2.2.0
├── iferr#0.1.5
├── imurmurhash#0.1.4
├── inflight#1.0.6
├── inherits#2.0.3
├── ini#1.3.4
├─┬ init-package-json#1.9.4
│ ├─┬ glob#6.0.4
│ │ ├─┬ minimatch#3.0.3
│ │ │ └─┬ brace-expansion#1.1.6
│ │ │ ├── balanced-match#0.4.2
│ │ │ └── concat-map#0.0.1
│ │ └── path-is-absolute#1.0.0
│ └── promzard#0.3.0
├─┬ JSONStream#1.3.0
│ ├── jsonparse#1.2.0
│ └── through#2.3.8
├── lazy-property#1.0.0
├── lockfile#1.0.3
├── lodash._baseindexof#3.1.0
├─┬ lodash._baseuniq#4.6.0
│ ├── lodash._createset#4.0.3
│ └── lodash._root#3.0.1
├── lodash._bindcallback#3.0.1
├── lodash._cacheindexof#3.0.2
├── lodash._createcache#3.1.2
├── lodash._getnative#3.9.1
├── lodash.clonedeep#4.5.0
├── lodash.restparam#3.6.1
├── lodash.union#4.6.0
├── lodash.uniq#4.5.0
├── lodash.without#4.4.0
├─┬ mississippi#1.3.0
│ ├─┬ concat-stream#1.6.0
│ │ └── typedarray#0.0.6
│ ├─┬ duplexify#3.5.0
│ │ ├─┬ end-of-stream#1.0.0
│ │ │ └── once#1.3.3
│ │ └── stream-shift#1.0.0
│ ├─┬ end-of-stream#1.1.0
│ │ └── once#1.3.3
│ ├── flush-write-stream#1.0.2
│ ├── from2#2.3.0
│ ├─┬ parallel-transform#1.1.0
│ │ └── cyclist#0.2.2
│ ├── pump#1.0.2
│ ├── pumpify#1.3.5
│ ├─┬ stream-each#1.2.0
│ │ └── stream-shift#1.0.0
│ └─┬ through2#2.0.3
│ └── xtend#4.0.1
├─┬ mkdirp#0.5.1
│ └── minimist#0.0.8
├─┬ node-gyp#3.5.0
│ ├─┬ minimatch#3.0.3
│ │ └─┬ brace-expansion#1.1.6
│ │ ├── balanced-match#0.4.2
│ │ └── concat-map#0.0.1
│ └── nopt#3.0.6
├─┬ nopt#4.0.1
│ └─┬ osenv#0.1.4
│ ├── os-homedir#1.0.2
│ └── os-tmpdir#1.0.2
├── normalize-git-url#3.0.2
├─┬ normalize-package-data#2.3.5
│ └─┬ is-builtin-module#1.0.0
│ └── builtin-modules#1.1.1
├── npm-cache-filename#1.0.2
├── npm-install-checks#3.0.0
├── npm-package-arg#4.2.0
├─┬ npm-registry-client#7.4.5
│ └─┬ concat-stream#1.5.2
│ ├─┬ readable-stream#2.0.6
│ │ ├── core-util-is#1.0.2
│ │ ├── isarray#1.0.0
│ │ ├── process-nextick-args#1.0.7
│ │ ├── string_decoder#0.10.31
│ │ └── util-deprecate#1.0.2
│ └── typedarray#0.0.6
├── npm-user-validate#0.1.5
├─┬ npmlog#4.0.2
│ ├─┬ are-we-there-yet#1.1.2
│ │ └── delegates#1.0.0
│ ├── console-control-strings#1.1.0
│ ├─┬ gauge#2.7.2
│ │ ├── object-assign#4.1.0
│ │ ├── signal-exit#3.0.2
│ │ ├─┬ string-width#1.0.2
│ │ │ ├── code-point-at#1.1.0
│ │ │ └─┬ is-fullwidth-code-point#1.0.0
│ │ │ └── number-is-nan#1.0.1
│ │ ├── supports-color#0.2.0
│ │ └── wide-align#1.1.0
│ └── set-blocking#2.0.0
├── once#1.4.0
├── opener#1.4.2
├─┬ osenv#0.1.4
│ ├── os-homedir#1.0.2
│ └── os-tmpdir#1.0.2
├── path-is-inside#1.0.2
├─┬ read#1.0.7
│ └── mute-stream#0.0.5
├── read-cmd-shim#1.0.1
├─┬ read-installed#4.0.3
│ └── util-extend#1.0.3
├─┬ read-package-json#2.0.4
│ ├─┬ glob#6.0.4
│ │ ├─┬ minimatch#3.0.3
│ │ │ └─┬ brace-expansion#1.1.6
│ │ │ ├── balanced-match#0.4.2
│ │ │ └── concat-map#0.0.1
│ │ └── path-is-absolute#1.0.0
│ └─┬ json-parse-helpfulerror#1.0.3
│ └── jju#1.3.0
├── read-package-tree#5.1.5
├─┬ readable-stream#2.2.2
│ ├── buffer-shims#1.0.0
│ ├── core-util-is#1.0.2
│ ├── isarray#1.0.0
│ ├── process-nextick-args#1.0.7
│ ├── string_decoder#0.10.31
│ └── util-deprecate#1.0.2
├── readdir-scoped-modules#1.0.2
├── realize-package-specifier#3.0.3
├─┬ request#2.79.0
│ ├── aws-sign2#0.6.0
│ ├── aws4#1.5.0
│ ├── caseless#0.11.0
│ ├─┬ combined-stream#1.0.5
│ │ └── delayed-stream#1.0.0
│ ├── extend#3.0.0
│ ├── forever-agent#0.6.1
│ ├─┬ form-data#2.1.2
│ │ └── asynckit#0.4.0
│ ├─┬ har-validator#2.0.6
│ │ ├─┬ chalk#1.1.3
│ │ │ ├── ansi-styles#2.2.1
│ │ │ ├── escape-string-regexp#1.0.5
│ │ │ ├── has-ansi#2.0.0
│ │ │ └── supports-color#2.0.0
│ │ ├─┬ commander#2.9.0
│ │ │ └── graceful-readlink#1.0.1
│ │ ├─┬ is-my-json-valid#2.15.0
│ │ │ ├── generate-function#2.0.0
│ │ │ ├─┬ generate-object-property#1.2.0
│ │ │ │ └── is-property#1.0.2
│ │ │ ├── jsonpointer#4.0.0
│ │ │ └── xtend#4.0.1
│ │ └─┬ pinkie-promise#2.0.1
│ │ └── pinkie#2.0.4
│ ├─┬ hawk#3.1.3
│ │ ├── boom#2.10.1
│ │ ├── cryptiles#2.0.5
│ │ ├── hoek#2.16.3
│ │ └── sntp#1.0.9
│ ├─┬ http-signature#1.1.1
│ │ ├── assert-plus#0.2.0
│ │ ├─┬ jsprim#1.3.1
│ │ │ ├── extsprintf#1.0.2
│ │ │ ├── json-schema#0.2.3
│ │ │ └── verror#1.3.6
│ │ └─┬ sshpk#1.10.1
│ │ ├── asn1#0.2.3
│ │ ├── assert-plus#1.0.0
│ │ ├── bcrypt-pbkdf#1.0.0
│ │ ├── dashdash#1.14.1
│ │ ├── ecc-jsbn#0.1.1
│ │ ├── getpass#0.1.6
│ │ ├── jodid25519#1.0.2
│ │ ├── jsbn#0.1.0
│ │ └── tweetnacl#0.14.3
│ ├── is-typedarray#1.0.0
│ ├── isstream#0.1.2
│ ├── json-stringify-safe#5.0.1
│ ├─┬ mime-types#2.1.13
│ │ └── mime-db#1.25.0
│ ├── oauth-sign#0.8.2
│ ├── qs#6.3.0
│ ├── stringstream#0.0.5
│ ├─┬ tough-cookie#2.3.2
│ │ └── punycode#1.4.1
│ └── tunnel-agent#0.4.3
├── retry#0.10.1
├── rimraf#2.5.4
├── semver#5.3.0
├── sha#2.0.1
├── slide#1.1.6
├── sorted-object#2.0.1
├─┬ sorted-union-stream#2.1.3
│ ├─┬ from2#1.3.0
│ │ └─┬ readable-stream#1.1.14
│ │ ├── core-util-is#1.0.2
│ │ ├── isarray#0.0.1
│ │ └── string_decoder#0.10.31
│ └── stream-iterate#1.1.1
├── strip-ansi#3.0.1
├─┬ tar#2.2.1
│ └── block-stream#0.0.8
├── text-table#0.2.0
├── uid-number#0.0.6
├── umask#1.1.0
├─┬ unique-filename#1.1.0
│ └── unique-slug#2.0.0
├── unpipe#1.0.0
├── uuid#3.0.1
├─┬ validate-npm-package-license#3.0.1
│ ├─┬ spdx-correct#1.0.2
│ │ └── spdx-license-ids#1.2.0
│ └─┬ spdx-expression-parse#1.0.2
│ ├── spdx-exceptions#1.0.4
│ └── spdx-license-ids#1.2.0
├─┬ validate-npm-package-name#2.2.2
│ └── builtins#0.0.7
├─┬ which#1.2.12
│ └── isexe#1.1.2
├── wrappy#1.0.2
└── write-file-atomic#1.3.1
I then attempted to run node . and received the following error
MacBook-Pro:marketing-notifications-node-master $USER$ node .
module.js:471
throw err;
^
Error: Cannot find module 'mongodb/node_modules/bson'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/$USER/Desktop/marketing-notifications-node-master/node_modules/mongoose/lib/drivers/node-mongodb-native/objectid.js:8:52)
at Module._compile (module.js:570:32)
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)
EDIT
I tried deleting and reclining the original project file. I did npm install and received this output:
npm install
npm WARN deprecated jade#1.11.0: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated node-uuid#1.4.7: use uuid module instead
npm WARN deprecated transformers#2.1.0: Deprecated, use jstransformer
npm WARN deprecated mongodb#1.4.12: Please upgrade to 2.2.19 or higher
npm WARN deprecated jade#0.26.3: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated to-iso-string#0.0.2: to-iso-string has been deprecated, use #segment/to-iso-string instead.
npm WARN deprecated minimatch#0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
> kerberos#0.0.4 install /Users/$USER/Desktop/marketing-notifications-node-master/node_modules/kerberos
> (node-gyp rebuild 2> builderror.log) || (exit 0)
> bson#0.2.22 install /Users/$USER/Desktop/marketing-notifications-node-master/node_modules/bson
> (node-gyp rebuild 2> builderror.log) || (exit 0)
sms-notifications-node#1.0.0 /Users/$USER/Desktop/marketing-notifications-node-master
├─┬ body-parser#1.17.1
│ ├── bytes#2.4.0
│ ├── content-type#1.0.2
│ ├─┬ debug#2.6.1
│ │ └── ms#0.7.2
│ ├── depd#1.1.0
│ ├─┬ http-errors#1.6.1
│ │ └── inherits#2.0.3
│ ├── iconv-lite#0.4.15
│ ├─┬ on-finished#2.3.0
│ │ └── ee-first#1.1.1
│ ├── qs#6.4.0
│ ├─┬ raw-body#2.2.0
│ │ └── unpipe#1.0.0
│ └─┬ type-is#1.6.14
│ ├── media-typer#0.3.0
│ └─┬ mime-types#2.1.14
│ └── mime-db#1.26.0
├─┬ chai#2.3.0
│ ├── assertion-error#1.0.0
│ └─┬ deep-eql#0.1.3
│ └── type-detect#0.1.1
├── connect-flash#0.1.1
├─┬ express#4.15.2
│ ├─┬ accepts#1.3.3
│ │ └── negotiator#0.6.1
│ ├── array-flatten#1.1.1
│ ├── content-disposition#0.5.2
│ ├── cookie#0.3.1
│ ├── cookie-signature#1.0.6
│ ├── encodeurl#1.0.1
│ ├── escape-html#1.0.3
│ ├── etag#1.8.0
│ ├── finalhandler#1.0.0
│ ├── fresh#0.5.0
│ ├── merge-descriptors#1.0.1
│ ├── methods#1.1.2
│ ├── parseurl#1.3.1
│ ├── path-to-regexp#0.1.7
│ ├─┬ proxy-addr#1.1.3
│ │ ├── forwarded#0.1.0
│ │ └── ipaddr.js#1.2.0
│ ├── range-parser#1.2.0
│ ├─┬ send#0.15.1
│ │ ├── destroy#1.0.4
│ │ └── mime#1.3.4
│ ├── serve-static#1.12.1
│ ├── setprototypeof#1.0.3
│ ├── statuses#1.3.1
│ ├── utils-merge#1.0.0
│ └── vary#1.1.0
├─┬ express-session#1.15.1
│ ├── crc#3.4.4
│ ├── on-headers#1.0.1
│ └─┬ uid-safe#2.1.4
│ └── random-bytes#1.0.0
├─┬ http-auth#2.4.11
│ ├─┬ apache-crypt#1.1.2
│ │ └── unix-crypt-td-js#1.0.0
│ ├── apache-md5#1.0.6
│ └── node-uuid#1.4.7
├─┬ jade#1.11.0
│ ├── character-parser#1.2.1
│ ├─┬ clean-css#3.4.25
│ │ ├─┬ commander#2.8.1
│ │ │ └── graceful-readlink#1.0.1
│ │ └─┬ source-map#0.4.4
│ │ └── amdefine#1.0.1
│ ├── commander#2.6.0
│ ├─┬ constantinople#3.0.2
│ │ └── acorn#2.7.0
│ ├─┬ jstransformer#0.0.2
│ │ ├── is-promise#2.1.0
│ │ └─┬ promise#6.1.0
│ │ └── asap#1.0.0
│ ├─┬ mkdirp#0.5.1
│ │ └── minimist#0.0.8
│ ├─┬ transformers#2.1.0
│ │ ├─┬ css#1.0.8
│ │ │ ├── css-parse#1.0.4
│ │ │ └── css-stringify#1.0.5
│ │ ├─┬ promise#2.0.0
│ │ │ └── is-promise#1.0.1
│ │ └─┬ uglify-js#2.2.5
│ │ ├─┬ optimist#0.3.7
│ │ │ └── wordwrap#0.0.3
│ │ └── source-map#0.1.43
│ ├─┬ uglify-js#2.8.8
│ │ ├── source-map#0.5.6
│ │ ├── uglify-to-browserify#1.0.2
│ │ └─┬ yargs#3.10.0
│ │ ├── camelcase#1.2.1
│ │ ├─┬ cliui#2.1.0
│ │ │ ├─┬ center-align#0.1.3
│ │ │ │ ├─┬ align-text#0.1.4
│ │ │ │ │ ├─┬ kind-of#3.1.0
│ │ │ │ │ │ └── is-buffer#1.1.4
│ │ │ │ │ ├── longest#1.0.1
│ │ │ │ │ └── repeat-string#1.6.1
│ │ │ │ └── lazy-cache#1.0.4
│ │ │ ├── right-align#0.1.3
│ │ │ └── wordwrap#0.0.2
│ │ ├── decamelize#1.2.0
│ │ └── window-size#0.1.0
│ ├── void-elements#2.0.1
│ └─┬ with#4.0.3
│ ├── acorn#1.2.2
│ └── acorn-globals#1.0.9
├─┬ mocha#2.5.3
│ ├── commander#2.3.0
│ ├─┬ debug#2.2.0
│ │ └── ms#0.7.1
│ ├── diff#1.4.0
│ ├── escape-string-regexp#1.0.2
│ ├─┬ glob#3.2.11
│ │ └─┬ minimatch#0.3.0
│ │ ├── lru-cache#2.7.3
│ │ └── sigmund#1.0.1
│ ├── growl#1.9.2
│ ├─┬ jade#0.26.3
│ │ ├── commander#0.6.1
│ │ └── mkdirp#0.3.0
│ ├── supports-color#1.2.0
│ └── to-iso-string#0.0.2
├─┬ mongoose#3.9.7
│ ├── async#0.9.0
│ ├── hooks#0.3.2
│ ├── kareem#0.0.4
│ ├─┬ mongodb#1.4.12
│ │ ├─┬ bson#0.2.22
│ │ │ └── nan#1.8.4
│ │ ├── kerberos#0.0.4
│ │ └─┬ readable-stream#2.2.3
│ │ ├── buffer-shims#1.0.0
│ │ ├── core-util-is#1.0.2
│ │ ├── isarray#1.0.0
│ │ ├── process-nextick-args#1.0.7
│ │ ├── string_decoder#0.10.31
│ │ └── util-deprecate#1.0.2
│ ├── mpath#0.1.1
│ ├── mpromise#0.5.4
│ ├─┬ mquery#1.0.0
│ │ └── debug#0.7.4
│ ├── ms#0.1.0
│ ├── muri#0.3.1
│ ├── regexp-clone#0.0.1
│ └── sliced#0.0.5
├─┬ morgan#1.8.1
│ └── basic-auth#1.1.0
└─┬ twilio#1.11.1
├── jwt-simple#0.1.0
├── q#0.9.7
├─┬ request#2.27.0
│ ├── aws-sign#0.3.0
│ ├── cookie-jar#0.3.0
│ ├── forever-agent#0.5.2
│ ├─┬ form-data#0.1.4
│ │ ├─┬ combined-stream#0.0.7
│ │ │ └── delayed-stream#0.0.5
│ │ └── mime#1.2.11
│ ├─┬ hawk#1.0.0
│ │ ├── boom#0.4.2
│ │ ├── cryptiles#0.2.2
│ │ ├── hoek#0.9.1
│ │ └── sntp#0.2.4
│ ├─┬ http-signature#0.10.1
│ │ ├── asn1#0.1.11
│ │ ├── assert-plus#0.1.5
│ │ └── ctype#0.5.3
│ ├── json-stringify-safe#5.0.1
│ ├── mime#1.2.11
│ ├── oauth-sign#0.3.0
│ ├── qs#0.6.6
│ └── tunnel-agent#0.3.0
├── scmp#0.0.3
└── underscore#1.8.3
I then tried to run node . and received the error:
MacBook-Pro:marketing-notifications-node-master $USER$ node .
module.js:471
throw err;
^
Error: Cannot find module 'mongodb/node_modules/bson'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/$USER/Desktop/marketing-notifications-node-master/node_modules/mongoose/lib/drivers/node-mongodb-native/objectid.js:8:52)
at Module._compile (module.js:570:32)
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)
EDIT
I've attempted to use npm install -g node-gyp then npm install mongoose#3.9.7
npm install -g node-gyp gave an output of :
MacBook-Pro:marketing-notifications-node-master $USER$ npm install -g node-gyp
/Users/$USER/.npm-packages/bin/node-gyp -> /Users/$USER/.npm-packages/lib/node_modules/node-gyp/bin/node-gyp.js
/Users/$USER/.npm-packages/lib
└── node-gyp#3.5.0
MacBook-Pro:marketing-notifications-node-master $USER$ npm install mongoose#3.9.7
npm WARN deprecated mongodb#1.4.12: Please upgrade to 2.2.19 or higher
sms-notifications-node#1.0.0 /Users/$USER/Desktop/marketing-notifications-node-master
└── mongoose#3.9.7
Twilio developer evangelist here.
I'm going to try to solve this outside of the comments as that is going to be difficult.
It looks as though you are having problems installing your dependencies. From this issue on npm's GitHub project the suggestion is to run:
npm cache clean
npm install -g npm#latest
Then try to run your full npm install again and if that works, run node .. Do all of this inside your project directory. If it doesn't work, please update your question with any error messages and I will try again!
Edit my output from npm install
$ npm install
npm WARN deprecated jade#1.11.0: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated node-uuid#1.4.7: use uuid module instead
npm WARN deprecated transformers#2.1.0: Deprecated, use jstransformer
npm WARN deprecated mongodb#1.4.12: Please upgrade to 2.2.19 or higher
npm WARN deprecated jade#0.26.3: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated to-iso-string#0.0.2: to-iso-string has been deprecated, use #segment/to-iso-string instead.
npm WARN deprecated minimatch#0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
> kerberos#0.0.4 install /Users/pnash/projects/node-projects/marketing-notifications-node/node_modules/kerberos
> (node-gyp rebuild 2> builderror.log) || (exit 0)
CXX(target) Release/obj.target/kerberos/lib/kerberos.o
> bson#0.2.22 install /Users/pnash/projects/node-projects/marketing-notifications-node/node_modules/bson
> (node-gyp rebuild 2> builderror.log) || (exit 0)
CXX(target) Release/obj.target/bson/ext/bson.o
sms-notifications-node#1.0.0 /Users/pnash/projects/node-projects/marketing-notifications-node
├─┬ body-parser#1.17.1
│ ├── bytes#2.4.0
│ ├── content-type#1.0.2
│ ├─┬ debug#2.6.1
│ │ └── ms#0.7.2
│ ├── depd#1.1.0
│ ├─┬ http-errors#1.6.1
│ │ └── inherits#2.0.3
│ ├── iconv-lite#0.4.15
│ ├─┬ on-finished#2.3.0
│ │ └── ee-first#1.1.1
│ ├── qs#6.4.0
│ ├─┬ raw-body#2.2.0
│ │ └── unpipe#1.0.0
│ └─┬ type-is#1.6.14
│ ├── media-typer#0.3.0
│ └─┬ mime-types#2.1.14
│ └── mime-db#1.26.0
├─┬ chai#2.3.0
│ ├── assertion-error#1.0.0
│ └─┬ deep-eql#0.1.3
│ └── type-detect#0.1.1
├── connect-flash#0.1.1
├─┬ express#4.15.2
│ ├─┬ accepts#1.3.3
│ │ └── negotiator#0.6.1
│ ├── array-flatten#1.1.1
│ ├── content-disposition#0.5.2
│ ├── cookie#0.3.1
│ ├── cookie-signature#1.0.6
│ ├── encodeurl#1.0.1
│ ├── escape-html#1.0.3
│ ├── etag#1.8.0
│ ├── finalhandler#1.0.0
│ ├── fresh#0.5.0
│ ├── merge-descriptors#1.0.1
│ ├── methods#1.1.2
│ ├── parseurl#1.3.1
│ ├── path-to-regexp#0.1.7
│ ├─┬ proxy-addr#1.1.3
│ │ ├── forwarded#0.1.0
│ │ └── ipaddr.js#1.2.0
│ ├── range-parser#1.2.0
│ ├─┬ send#0.15.1
│ │ ├── destroy#1.0.4
│ │ └── mime#1.3.4
│ ├── serve-static#1.12.1
│ ├── setprototypeof#1.0.3
│ ├── statuses#1.3.1
│ ├── utils-merge#1.0.0
│ └── vary#1.1.0
├─┬ express-session#1.15.1
│ ├── crc#3.4.4
│ ├── on-headers#1.0.1
│ └─┬ uid-safe#2.1.4
│ └── random-bytes#1.0.0
├─┬ http-auth#2.4.11
│ ├─┬ apache-crypt#1.1.2
│ │ └── unix-crypt-td-js#1.0.0
│ ├── apache-md5#1.0.6
│ └── node-uuid#1.4.7
├─┬ jade#1.11.0
│ ├── character-parser#1.2.1
│ ├─┬ clean-css#3.4.25
│ │ ├─┬ commander#2.8.1
│ │ │ └── graceful-readlink#1.0.1
│ │ └─┬ source-map#0.4.4
│ │ └── amdefine#1.0.1
│ ├── commander#2.6.0
│ ├─┬ constantinople#3.0.2
│ │ └── acorn#2.7.0
│ ├─┬ jstransformer#0.0.2
│ │ ├── is-promise#2.1.0
│ │ └─┬ promise#6.1.0
│ │ └── asap#1.0.0
│ ├─┬ mkdirp#0.5.1
│ │ └── minimist#0.0.8
│ ├─┬ transformers#2.1.0
│ │ ├─┬ css#1.0.8
│ │ │ ├── css-parse#1.0.4
│ │ │ └── css-stringify#1.0.5
│ │ ├─┬ promise#2.0.0
│ │ │ └── is-promise#1.0.1
│ │ └─┬ uglify-js#2.2.5
│ │ ├─┬ optimist#0.3.7
│ │ │ └── wordwrap#0.0.3
│ │ └── source-map#0.1.43
│ ├─┬ uglify-js#2.8.8
│ │ ├── source-map#0.5.6
│ │ ├── uglify-to-browserify#1.0.2
│ │ └─┬ yargs#3.10.0
│ │ ├── camelcase#1.2.1
│ │ ├─┬ cliui#2.1.0
│ │ │ ├─┬ center-align#0.1.3
│ │ │ │ ├─┬ align-text#0.1.4
│ │ │ │ │ ├─┬ kind-of#3.1.0
│ │ │ │ │ │ └── is-buffer#1.1.4
│ │ │ │ │ ├── longest#1.0.1
│ │ │ │ │ └── repeat-string#1.6.1
│ │ │ │ └── lazy-cache#1.0.4
│ │ │ ├── right-align#0.1.3
│ │ │ └── wordwrap#0.0.2
│ │ ├── decamelize#1.2.0
│ │ └── window-size#0.1.0
│ ├── void-elements#2.0.1
│ └─┬ with#4.0.3
│ ├── acorn#1.2.2
│ └── acorn-globals#1.0.9
├─┬ mocha#2.5.3
│ ├── commander#2.3.0
│ ├─┬ debug#2.2.0
│ │ └── ms#0.7.1
│ ├── diff#1.4.0
│ ├── escape-string-regexp#1.0.2
│ ├─┬ glob#3.2.11
│ │ └─┬ minimatch#0.3.0
│ │ ├── lru-cache#2.7.3
│ │ └── sigmund#1.0.1
│ ├── growl#1.9.2
│ ├─┬ jade#0.26.3
│ │ ├── commander#0.6.1
│ │ └── mkdirp#0.3.0
│ ├── supports-color#1.2.0
│ └── to-iso-string#0.0.2
├─┬ mongoose#3.9.7
│ ├── async#0.9.0
│ ├── hooks#0.3.2
│ ├── kareem#0.0.4
│ ├─┬ mongodb#1.4.12
│ │ ├─┬ bson#0.2.22
│ │ │ └── nan#1.8.4
│ │ ├── kerberos#0.0.4
│ │ └─┬ readable-stream#2.2.3
│ │ ├── buffer-shims#1.0.0
│ │ ├── core-util-is#1.0.2
│ │ ├── isarray#1.0.0
│ │ ├── process-nextick-args#1.0.7
│ │ ├── string_decoder#0.10.31
│ │ └── util-deprecate#1.0.2
│ ├── mpath#0.1.1
│ ├── mpromise#0.5.4
│ ├─┬ mquery#1.0.0
│ │ └── debug#0.7.4
│ ├── ms#0.1.0
│ ├── muri#0.3.1
│ ├── regexp-clone#0.0.1
│ └── sliced#0.0.5
├─┬ morgan#1.8.1
│ └── basic-auth#1.1.0
└─┬ twilio#1.11.1
├── jwt-simple#0.1.0
├── q#0.9.7
├─┬ request#2.27.0
│ ├── aws-sign#0.3.0
│ ├── cookie-jar#0.3.0
│ ├── forever-agent#0.5.2
│ ├─┬ form-data#0.1.4
│ │ ├─┬ combined-stream#0.0.7
│ │ │ └── delayed-stream#0.0.5
│ │ └── mime#1.2.11
│ ├─┬ hawk#1.0.0
│ │ ├── boom#0.4.2
│ │ ├── cryptiles#0.2.2
│ │ ├── hoek#0.9.1
│ │ └── sntp#0.2.4
│ ├─┬ http-signature#0.10.1
│ │ ├── asn1#0.1.11
│ │ ├── assert-plus#0.1.5
│ │ └── ctype#0.5.3
│ ├── json-stringify-safe#5.0.1
│ ├── mime#1.2.11
│ ├── oauth-sign#0.3.0
│ ├── qs#0.6.6
│ └── tunnel-agent#0.3.0
├── scmp#0.0.3
└── underscore#1.8.3
I have a Meteor app deployed with Passenger + Nginx (as follow) on AWS EC2 instance under Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-62-generic x86_64)
The problem is that it takes around 100% CPU usage permanently.
I've tried to switch to more powerful instance and even deployed a blank app instead of mine - still the same.
Any ideas where to dig?
Thanks.
P.S.
var/log/nginx/error.log:
2017/02/08 08:04:20 [info] 18232#18232: Using 32768KiB of shared memory for nchan in /etc/nginx/nginx.conf:71
[ 2017-02-08 08:04:20.4123 18239/7fe378ac0780 age/Wat/WatchdogMain.cpp:1281 ]: Starting Passenger watchdog...
[ 2017-02-08 08:04:20.4281 18242/7f7adea7b780 age/Cor/CoreMain.cpp:1070 ]: Starting Passenger core...
[ 2017-02-08 08:04:20.4282 18242/7f7adea7b780 age/Cor/CoreMain.cpp:245 ]: Passenger core running in multi-application mode.
[ 2017-02-08 08:04:20.4309 18242/7f7adea7b780 age/Cor/CoreMain.cpp:820 ]: Passenger core online, PID 18242
[ 2017-02-08 08:04:20.4511 18248/7fdc44af6780 age/Ust/UstRouterMain.cpp:529 ]: Starting Passenger UstRouter...
[ 2017-02-08 08:04:20.4517 18248/7fdc44af6780 age/Ust/UstRouterMain.cpp:342 ]: Passenger UstRouter online, PID 18248
[ 2017-02-08 08:04:22.7236 18242/7f7ade98c700 age/Cor/SecurityUpdateChecker.h:464 ]: Security update check: no update found (next check in 24 hours)
npm install output:
> fibers#1.0.15 install /var/www/play/bundle/programs/server/node_modules/fibers
> node build.js || nodejs build.js
`linux-x64-48` exists; testing
Binary is fine; exiting
> meteor-dev-bundle#0.0.0 install /var/www/play/bundle/programs/server
> node npm-rebuild.js
{
"meteor-dev-bundle": "0.0.0",
"npm": "3.10.10",
"ares": "1.10.1-DEV",
"http_parser": "2.7.0",
"icu": "56.1",
"modules": "48",
"node": "6.9.5",
"openssl": "1.0.2k",
"uv": "1.9.1",
"v8": "5.1.281.89",
"zlib": "1.2.8"
}
meteor-dev-bundle#0.0.0 /var/www/play/bundle/programs/server
├── amdefine#1.0.1
├── asap#2.0.5
├── fibers#1.0.15
├── meteor-promise#0.8.0
├─┬ node-gyp#3.4.0
│ ├─┬ fstream#1.0.10
│ │ └── inherits#2.0.3
│ ├─┬ glob#7.1.1
│ │ ├── fs.realpath#1.0.0
│ │ ├─┬ inflight#1.0.6
│ │ │ └── wrappy#1.0.2
│ │ ├── once#1.4.0
│ │ └── path-is-absolute#1.0.1
│ ├── graceful-fs#4.1.11
│ ├─┬ minimatch#3.0.3
│ │ └─┬ brace-expansion#1.1.6
│ │ ├── balanced-match#0.4.2
│ │ └── concat-map#0.0.1
│ ├─┬ mkdirp#0.5.1
│ │ └── minimist#0.0.8
│ ├─┬ nopt#3.0.6
│ │ └── abbrev#1.0.9
│ ├─┬ npmlog#3.1.2
│ │ ├─┬ are-we-there-yet#1.1.2
│ │ │ ├── delegates#1.0.0
│ │ │ └── readable-stream#2.2.2
│ │ ├── console-control-strings#1.1.0
│ │ ├─┬ gauge#2.6.0
│ │ │ ├── aproba#1.1.0
│ │ │ ├── has-color#0.1.7
│ │ │ ├── has-unicode#2.0.1
│ │ │ ├── object-assign#4.1.1
│ │ │ ├── signal-exit#3.0.2
│ │ │ ├─┬ string-width#1.0.2
│ │ │ │ ├── code-point-at#1.1.0
│ │ │ │ └─┬ is-fullwidth-code-point#1.0.0
│ │ │ │ └── number-is-nan#1.0.1
│ │ │ ├─┬ strip-ansi#3.0.1
│ │ │ │ └── ansi-regex#2.1.1
│ │ │ └── wide-align#1.1.0
│ │ └── set-blocking#2.0.0
│ ├─┬ osenv#0.1.4
│ │ ├── os-homedir#1.0.2
│ │ └── os-tmpdir#1.0.2
│ ├─┬ path-array#1.0.1
│ │ └─┬ array-index#1.0.0
│ │ ├─┬ debug#2.6.0
│ │ │ └── ms#0.7.2
│ │ └─┬ es6-symbol#3.1.0
│ │ ├── d#0.1.1
│ │ └─┬ es5-ext#0.10.12
│ │ └── es6-iterator#2.0.0
│ ├─┬ request#2.79.0
│ │ ├── aws-sign2#0.6.0
│ │ ├── aws4#1.6.0
│ │ ├── caseless#0.11.0
│ │ ├─┬ combined-stream#1.0.5
│ │ │ └── delayed-stream#1.0.0
│ │ ├── extend#3.0.0
│ │ ├── forever-agent#0.6.1
│ │ ├─┬ form-data#2.1.2
│ │ │ └── asynckit#0.4.0
│ │ ├─┬ har-validator#2.0.6
│ │ │ ├─┬ chalk#1.1.3
│ │ │ │ ├── ansi-styles#2.2.1
│ │ │ │ ├── escape-string-regexp#1.0.5
│ │ │ │ ├── has-ansi#2.0.0
│ │ │ │ └── supports-color#2.0.0
│ │ │ ├─┬ commander#2.9.0
│ │ │ │ └── graceful-readlink#1.0.1
│ │ │ ├─┬ is-my-json-valid#2.15.0
│ │ │ │ ├── generate-function#2.0.0
│ │ │ │ ├─┬ generate-object-property#1.2.0
│ │ │ │ │ └── is-property#1.0.2
│ │ │ │ ├── jsonpointer#4.0.1
│ │ │ │ └── xtend#4.0.1
│ │ │ └─┬ pinkie-promise#2.0.1
│ │ │ └── pinkie#2.0.4
│ │ ├─┬ hawk#3.1.3
│ │ │ ├── boom#2.10.1
│ │ │ ├── cryptiles#2.0.5
│ │ │ ├── hoek#2.16.3
│ │ │ └── sntp#1.0.9
│ │ ├─┬ http-signature#1.1.1
│ │ │ ├── assert-plus#0.2.0
│ │ │ ├─┬ jsprim#1.3.1
│ │ │ │ ├── extsprintf#1.0.2
│ │ │ │ ├── json-schema#0.2.3
│ │ │ │ └── verror#1.3.6
│ │ │ └─┬ sshpk#1.10.2
│ │ │ ├── asn1#0.2.3
│ │ │ ├── assert-plus#1.0.0
│ │ │ ├── bcrypt-pbkdf#1.0.1
│ │ │ ├─┬ dashdash#1.14.1
│ │ │ │ └── assert-plus#1.0.0
│ │ │ ├── ecc-jsbn#0.1.1
│ │ │ ├─┬ getpass#0.1.6
│ │ │ │ └── assert-plus#1.0.0
│ │ │ ├── jodid25519#1.0.2
│ │ │ ├── jsbn#0.1.0
│ │ │ └── tweetnacl#0.14.5
│ │ ├── is-typedarray#1.0.0
│ │ ├── isstream#0.1.2
│ │ ├── json-stringify-safe#5.0.1
│ │ ├─┬ mime-types#2.1.14
│ │ │ └── mime-db#1.26.0
│ │ ├── oauth-sign#0.8.2
│ │ ├── qs#6.3.0
│ │ ├── stringstream#0.0.5
│ │ ├─┬ tough-cookie#2.3.2
│ │ │ └── punycode#1.4.1
│ │ ├── tunnel-agent#0.4.3
│ │ └── uuid#3.0.1
│ ├── rimraf#2.5.4
│ ├─┬ tar#2.2.1
│ │ └── block-stream#0.0.9
│ └─┬ which#1.2.12
│ └── isexe#1.1.2
├─┬ node-pre-gyp#0.6.29
│ ├─┬ rc#1.1.6
│ │ ├── deep-extend#0.4.1
│ │ ├── ini#1.3.4
│ │ ├── minimist#1.2.0
│ │ └── strip-json-comments#1.0.4
│ ├── semver#5.2.0
│ └─┬ tar-pack#3.1.4
│ ├─┬ debug#2.2.0
│ │ └── ms#0.7.1
│ ├── fstream-ignore#1.0.5
│ ├── once#1.3.3
│ ├─┬ readable-stream#2.1.5
│ │ ├── buffer-shims#1.0.0
│ │ ├── core-util-is#1.0.2
│ │ ├── isarray#1.0.0
│ │ ├── process-nextick-args#1.0.7
│ │ ├── string_decoder#0.10.31
│ │ └── util-deprecate#1.0.2
│ └── uid-number#0.0.6
├── promise#7.1.1
├── semver#4.1.0
├── source-map#0.1.32
├── source-map-support#0.3.2
└── underscore#1.5.2
npm WARN meteor-dev-bundle#0.0.0 No description
npm WARN meteor-dev-bundle#0.0.0 No repository field.
npm WARN meteor-dev-bundle#0.0.0 No license field.
According to the Meteor deployment guide, you have to use specifically Node 4.6.2.
Depending on the version of Meteor you are using, you should install
the proper version of node using the appropriate installation process
for your platform.
Node 4.6.2 for Meteor 1.4.x
Node 0.10.43 for Meteor 1.3.x and earlier
If you use a mismatched version of Node when deploying your
application, you will encounter errors!
Passenger docs also suggest a 4.x version of node.
It worked for me with node js v4.8.4. Now CPU rarely goes above 10%.
Fixed it by reinstalling everything from the scratch. Still don't know what happend.
It's happening again, approximately once per day:
Wonder if there is some alternative for Passenger + Nginx?
Node version as mentioned in above answers strictly matters. You can try installing nginx+ pm2. It works like charm. To know more about pm2 , I already answered here.
How to run built of Meteor's sample app via Node
This is driving me crazy. I am in charge of the development and need to do merging of branches, but exactly on my machine only something is not working.
I have several times removed node_modules and run npm install, and even completely cloned the repo and setup everything again, and always I will get the same issue.
Someone merged code with ES6, so we need to transpile it, because the minifier plugin does not work with ES6 code.
So we use gulp-babel
var
gulp = require('gulp')
//more requires
, babel = require('gulp-babel')
var libs_js = [
//list of javascripts
]
gulp.task('js-build', function () {
gulp.src(libs_js)
.pipe(sourcemaps.init())
.pipe(ngAnnotate())
.pipe(running_task != 'js-build' ? _bypass() : tap(function(f) { f.contents = new Buffer('document.write(\'<script src="' + f.path.replace(process.cwd(), '')
.replaceAll('\\','/') // fix paths for windows
+ '"><\/script>\')') }))
.pipe(concat(pkg.name + '.js', {newLine: '\n;'}))
.pipe(babel({presets: ['es2015'],compact: false}))
.pipe(running_task == 'js-build' ? _bypass() : uglify())
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('dist'))
.on('end', function () {
console.log('[' + new Date + '] js compiled')
})
});
//other gulp targets
gulp.task('prod', ['js-build', 'css', 'sass', 'assets', 'libs']);
running gulp prod, for everyone it works, BUT for me, I get:
...
[Wed Oct 26 2016 22:05:51 GMT-0500 (COT)] asset completedd
events.js:141
throw er; // Unhandled 'error' event
^
Error: Couldn't find preset "latest" relative to directory "/home/me/prj/src"
at /home/me/prj/src/frontend/node_modules/babel-core/lib/transformation/file/options/option-manager.js:299:19
First, why complaining about "latest", if in the code we use es2015. I went and ran everything on an other computer, where it worked, and I found something astonishing:
On my machine:
>$ npm list | grep babel
├─┬ babel-preset-es2015#6.18.0
│ ├─┬ babel-plugin-check-es2015-constants#6.8.0
│ │ └─┬ babel-runtime#6.18.0
│ ├── babel-plugin-transform-es2015-arrow-functions#6.8.0
│ ├── babel-plugin-transform-es2015-block-scoped-functions#6.8.0
│ ├─┬ babel-plugin-transform-es2015-block-scoping#6.18.0
│ │ ├─┬ babel-template#6.16.0
│ │ ├─┬ babel-traverse#6.18.0
│ │ ├─┬ babel-types#6.18.0
│ ├─┬ babel-plugin-transform-es2015-classes#6.18.0
│ │ ├─┬ babel-helper-define-map#6.18.0
│ │ ├── babel-helper-function-name#6.18.0
│ │ ├── babel-helper-optimise-call-expression#6.18.0
│ │ ├── babel-helper-replace-supers#6.18.0
│ │ └── babel-messages#6.8.0
│ ├── babel-plugin-transform-es2015-computed-properties#6.8.0
│ ├── babel-plugin-transform-es2015-destructuring#6.18.0
│ ├── babel-plugin-transform-es2015-duplicate-keys#6.8.0
│ ├── babel-plugin-transform-es2015-for-of#6.18.0
│ ├── babel-plugin-transform-es2015-function-name#6.9.0
│ ├── babel-plugin-transform-es2015-literals#6.8.0
│ ├── babel-plugin-transform-es2015-modules-amd#6.18.0
│ ├─┬ babel-plugin-transform-es2015-modules-commonjs#6.18.0
│ │ └── babel-plugin-transform-strict-mode#6.18.0
│ ├─┬ babel-plugin-transform-es2015-modules-systemjs#6.18.0
│ │ └── babel-helper-hoist-variables#6.18.0
│ ├── babel-plugin-transform-es2015-modules-umd#6.18.0
│ ├── babel-plugin-transform-es2015-object-super#6.8.0
│ ├─┬ babel-plugin-transform-es2015-parameters#6.18.0
│ │ ├── babel-helper-call-delegate#6.18.0
│ │ └── babel-helper-get-function-arity#6.18.0
│ ├── babel-plugin-transform-es2015-shorthand-properties#6.18.0
│ ├── babel-plugin-transform-es2015-spread#6.8.0
│ ├─┬ babel-plugin-transform-es2015-sticky-regex#6.8.0
│ │ └─┬ babel-helper-regex#6.18.0
│ ├── babel-plugin-transform-es2015-template-literals#6.8.0
│ ├── babel-plugin-transform-es2015-typeof-symbol#6.18.0
│ ├─┬ babel-plugin-transform-es2015-unicode-regex#6.11.0
│ └─┬ babel-plugin-transform-regenerator#6.16.1
├─┬ gulp-babel#6.1.2
│ ├─┬ babel-core#6.18.0
│ │ ├─┬ babel-code-frame#6.16.0
│ │ ├─┬ babel-generator#6.18.0
│ │ ├── babel-helpers#6.16.0
│ │ ├─┬ babel-register#6.18.0
On the other one:
$ npm list | grep babel
├─┬ babel-preset-es2015#6.18.0
│ ├─┬ babel-plugin-check-es2015-constants#6.8.0
│ │ └─┬ babel-runtime#6.18.0
│ ├─┬ babel-plugin-transform-es2015-arrow-functions#6.8.0
│ │ └─┬ babel-runtime#6.18.0
│ ├─┬ babel-plugin-transform-es2015-block-scoped-functions#6.8.0
│ │ └─┬ babel-runtime#6.18.0
│ ├─┬ babel-plugin-transform-es2015-block-scoping#6.18.0
│ │ ├─┬ babel-runtime#6.18.0
│ │ ├─┬ babel-template#6.16.0
│ │ ├─┬ babel-traverse#6.18.0
│ │ │ ├─┬ babel-code-frame#6.16.0
│ │ │ ├── babel-messages#6.8.0
│ │ ├─┬ babel-types#6.18.0
│ ├─┬ babel-plugin-transform-es2015-classes#6.18.0
│ │ ├─┬ babel-helper-define-map#6.18.0
│ │ ├─┬ babel-helper-function-name#6.18.0
│ │ │ └── babel-helper-get-function-arity#6.18.0
│ │ ├── babel-helper-optimise-call-expression#6.18.0
│ │ ├── babel-helper-replace-supers#6.18.0
│ │ ├── babel-messages#6.8.0
│ │ ├─┬ babel-runtime#6.18.0
│ │ ├─┬ babel-template#6.16.0
│ │ ├─┬ babel-traverse#6.18.0
│ │ │ ├─┬ babel-code-frame#6.16.0
│ │ └─┬ babel-types#6.18.0
│ ├─┬ babel-plugin-transform-es2015-computed-properties#6.8.0
│ │ ├─┬ babel-helper-define-map#6.18.0
│ │ │ ├─┬ babel-helper-function-name#6.18.0
│ │ │ │ ├── babel-helper-get-function-arity#6.18.0
│ │ │ │ └─┬ babel-traverse#6.18.0
│ │ │ │ ├─┬ babel-code-frame#6.16.0
│ │ │ │ ├── babel-messages#6.8.0
│ │ │ ├─┬ babel-types#6.18.0
│ │ ├─┬ babel-runtime#6.18.0
│ │ └─┬ babel-template#6.16.0
│ │ ├─┬ babel-traverse#6.18.0
│ │ │ ├─┬ babel-code-frame#6.16.0
│ │ │ ├── babel-messages#6.8.0
│ │ ├─┬ babel-types#6.18.0
│ ├─┬ babel-plugin-transform-es2015-destructuring#6.18.0
│ │ └─┬ babel-runtime#6.18.0
│ ├─┬ babel-plugin-transform-es2015-duplicate-keys#6.8.0
│ │ ├─┬ babel-runtime#6.18.0
│ │ └─┬ babel-types#6.18.0
│ ├─┬ babel-plugin-transform-es2015-for-of#6.18.0
│ │ └─┬ babel-runtime#6.18.0
│ ├─┬ babel-plugin-transform-es2015-function-name#6.9.0
│ │ ├─┬ babel-helper-function-name#6.18.0
│ │ │ ├── babel-helper-get-function-arity#6.18.0
│ │ │ ├─┬ babel-template#6.16.0
│ │ │ └─┬ babel-traverse#6.18.0
│ │ │ ├─┬ babel-code-frame#6.16.0
│ │ │ ├── babel-messages#6.8.0
│ │ ├─┬ babel-runtime#6.18.0
│ │ └─┬ babel-types#6.18.0
│ ├─┬ babel-plugin-transform-es2015-literals#6.8.0
│ │ └─┬ babel-runtime#6.18.0
│ ├─┬ babel-plugin-transform-es2015-modules-amd#6.18.0
│ │ ├─┬ babel-runtime#6.18.0
│ │ └─┬ babel-template#6.16.0
│ │ ├─┬ babel-traverse#6.18.0
│ │ │ ├─┬ babel-code-frame#6.16.0
│ │ │ ├── babel-messages#6.8.0
│ │ ├─┬ babel-types#6.18.0
│ ├─┬ babel-plugin-transform-es2015-modules-commonjs#6.18.0
│ │ ├── babel-plugin-transform-strict-mode#6.18.0
│ │ ├─┬ babel-runtime#6.18.0
│ │ ├─┬ babel-template#6.16.0
│ │ │ ├─┬ babel-traverse#6.18.0
│ │ │ │ ├─┬ babel-code-frame#6.16.0
│ │ │ │ ├── babel-messages#6.8.0
│ │ └─┬ babel-types#6.18.0
│ ├─┬ babel-plugin-transform-es2015-modules-systemjs#6.18.0
│ │ ├─┬ babel-helper-hoist-variables#6.18.0
│ │ │ └─┬ babel-types#6.18.0
│ │ ├─┬ babel-runtime#6.18.0
│ │ └─┬ babel-template#6.16.0
│ │ ├─┬ babel-traverse#6.18.0
│ │ │ ├─┬ babel-code-frame#6.16.0
│ │ │ ├── babel-messages#6.8.0
│ │ ├─┬ babel-types#6.18.0
│ ├─┬ babel-plugin-transform-es2015-modules-umd#6.18.0
│ │ ├─┬ babel-runtime#6.18.0
│ │ └─┬ babel-template#6.16.0
│ │ ├─┬ babel-traverse#6.18.0
│ │ │ ├─┬ babel-code-frame#6.16.0
│ │ │ ├── babel-messages#6.8.0
│ │ ├─┬ babel-types#6.18.0
│ ├─┬ babel-plugin-transform-es2015-object-super#6.8.0
│ │ ├─┬ babel-helper-replace-supers#6.18.0
│ │ │ ├── babel-helper-optimise-call-expression#6.18.0
│ │ │ ├── babel-messages#6.8.0
│ │ │ ├─┬ babel-template#6.16.0
│ │ │ ├─┬ babel-traverse#6.18.0
│ │ │ │ ├─┬ babel-code-frame#6.16.0
│ │ │ └─┬ babel-types#6.18.0
│ │ └─┬ babel-runtime#6.18.0
│ ├─┬ babel-plugin-transform-es2015-parameters#6.18.0
│ │ ├─┬ babel-helper-call-delegate#6.18.0
│ │ │ └── babel-helper-hoist-variables#6.18.0
│ │ ├── babel-helper-get-function-arity#6.18.0
│ │ ├─┬ babel-runtime#6.18.0
│ │ ├─┬ babel-template#6.16.0
│ │ ├─┬ babel-traverse#6.18.0
│ │ │ ├─┬ babel-code-frame#6.16.0
│ │ │ ├── babel-messages#6.8.0
│ │ └─┬ babel-types#6.18.0
│ ├─┬ babel-plugin-transform-es2015-shorthand-properties#6.18.0
│ │ ├─┬ babel-runtime#6.18.0
│ │ └─┬ babel-types#6.18.0
│ ├─┬ babel-plugin-transform-es2015-spread#6.8.0
│ │ └─┬ babel-runtime#6.18.0
│ ├─┬ babel-plugin-transform-es2015-sticky-regex#6.8.0
│ │ ├─┬ babel-helper-regex#6.18.0
│ │ ├─┬ babel-runtime#6.18.0
│ │ └─┬ babel-types#6.18.0
│ ├─┬ babel-plugin-transform-es2015-template-literals#6.8.0
│ │ └─┬ babel-runtime#6.18.0
│ ├─┬ babel-plugin-transform-es2015-typeof-symbol#6.18.0
│ │ └─┬ babel-runtime#6.18.0
│ ├─┬ babel-plugin-transform-es2015-unicode-regex#6.11.0
│ │ ├─┬ babel-helper-regex#6.18.0
│ │ │ ├─┬ babel-types#6.18.0
│ │ ├─┬ babel-runtime#6.18.0
│ └─┬ babel-plugin-transform-regenerator#6.16.1
│ ├─┬ babel-runtime#6.18.0
│ ├─┬ babel-types#6.18.0
├─┬ gulp-babel#6.1.2
│ ├─┬ babel-core#6.18.0
│ │ ├─┬ babel-code-frame#6.16.0
│ │ ├─┬ babel-generator#6.18.0
│ │ ├── babel-helpers#6.16.0
│ │ ├── babel-messages#6.8.0
│ │ ├─┬ babel-register#6.18.0
│ │ ├─┬ babel-runtime#6.18.0
│ │ ├── babel-template#6.16.0
│ │ ├─┬ babel-traverse#6.18.0
│ │ ├─┬ babel-types#6.18.0
They are different!!!!
How the heck is this even possible???
I mean I used the exact same commands on both machines, package.json is the same for everybody, and no different command other than npm install and gulp prod has been run (I even used gulp from node_modules/.bin/gulp)
The only things I could think of:
- There's something binary which could cause problems
- node or npm versions? Using node 5.1 here
- Some concurrency issue, as my PC is using SSD storage?
For reference, here package.json
{
"name": "Proj",
"version": "0.1.0",
"description": "",
"main": "index.js",
"scripts": {
"heroku-postbuild": "bower install && gulp prod"
},
"author": "",
"license": "ISC",
"devDependencies": {
"babel-preset-es2015": "^6.18.0",
"concurrently": "^2.2.0",
"gulp": "^3.9.1",
"gulp-babel": "^6.1.2",
"gulp-concat": "^2.6.0",
"jasmine-core": "^2.4.1",
"karma": "^1.1.2",
"karma-coverage": "^1.1.1",
"karma-jasmine": "^1.0.2",
"karma-phantomjs-launcher": "^1.0.1",
"mkdirp": "^0.5.1"
},
"dependencies": {
"bower": "^1.7.9",
"colors": "^1.1.2",
"compression": "^1.6.2",
"es6-promise": "^3.2.1",
"express": "^4.14.0",
"fb-watchman": "^1.9.0",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.1",
"gulp-concat": "^2.6.0",
"gulp-minify-css": "^1.2.4",
"gulp-ng-annotate": "^2.0.0",
"gulp-plumber": "^1.1.0",
"gulp-sass": "^2.3.2",
"gulp-sourcemaps": "^1.6.0",
"gulp-tap": "^0.1.3",
"gulp-uglify": "^2.0.0",
"request": "^2.74.0",
"uglify-js": "^2.7.4"
}
}
Add this to your package.json
"babel": {
"presets": [
"es2015"
]
},
or to an existing .babelrc if you have one
I am trying to install topojson with node.js and I am getting a frustrating error. I reinstalled the latest version of node.js (4.4.5) and running the standard install method. It seems like everything installs correctly. Then I try to do something with topojson and it is clear that not everything is installed correctly--illegal operation on directory. So it seems like it is installed but that I am having permission problems perhaps? Can anyone help with this?
C:\>npm install -g topojson
C:\Users\Seth\AppData\Roaming\npm\topojson-geojson -> C:\Users\Seth\AppData\Roaming\npm\node_modules\topojson\bin\topojson-geojson
C:\Users\Seth\AppData\Roaming\npm\topojson -> C:\Users\Seth\AppData\Roaming\npm\node_modules\topojson\bin\topojson
C:\Users\Seth\AppData\Roaming\npm\topojson-merge -> C:\Users\Seth\AppData\Roaming\npm\node_modules\topojson\bin\topojson-merge
C:\Users\Seth\AppData\Roaming\npm\topojson-group -> C:\Users\Seth\AppData\Roaming\npm\node_modules\topojson\bin\topojson-group
C:\Users\Seth\AppData\Roaming\npm\topojson-svg -> C:\Users\Seth\AppData\Roaming\npm\node_modules\topojson\bin\topojson-svg
C:\Users\Seth\AppData\Roaming\npm
└─┬ topojson#1.6.26
├── d3#3.5.17
├─┬ d3-geo-projection#0.2.16
│ └─┬ brfs#1.4.3
│ ├─┬ quote-stream#1.0.2
│ │ ├── buffer-equal#0.0.1
│ │ └── minimist#1.2.0
│ ├── resolve#1.1.7
│ ├─┬ static-module#1.3.1
│ │ ├─┬ concat-stream#1.4.10
│ │ │ ├── inherits#2.0.1
│ │ │ ├─┬ readable-stream#1.1.14
│ │ │ │ └── isarray#0.0.1
│ │ │ └── typedarray#0.0.6
│ │ ├─┬ duplexer2#0.0.2
│ │ │ └─┬ readable-stream#1.1.14
│ │ │ └── isarray#0.0.1
│ │ ├─┬ escodegen#1.3.3
│ │ │ ├── esprima#1.1.1
│ │ │ ├── estraverse#1.5.1
│ │ │ ├── esutils#1.0.0
│ │ │ └─┬ source-map#0.1.43
│ │ │ └── amdefine#1.0.0
│ │ ├─┬ falafel#1.2.0
│ │ │ ├── acorn#1.2.2
│ │ │ ├── foreach#2.0.5
│ │ │ ├── isarray#0.0.1
│ │ │ └── object-keys#1.0.9
│ │ ├─┬ has#1.0.1
│ │ │ └── function-bind#1.1.0
│ │ ├── object-inspect#0.4.0
│ │ ├─┬ quote-stream#0.0.0
│ │ │ └── minimist#0.0.8
│ │ ├─┬ readable-stream#1.0.34
│ │ │ ├── core-util-is#1.0.2
│ │ │ ├── isarray#0.0.1
│ │ │ └── string_decoder#0.10.31
│ │ ├── shallow-copy#0.0.1
│ │ ├─┬ static-eval#0.2.4
│ │ │ └─┬ escodegen#0.0.28
│ │ │ ├── esprima#1.0.4
│ │ │ └── estraverse#1.3.2
│ │ └─┬ through2#0.4.2
│ │ └─┬ xtend#2.1.2
│ │ └── object-keys#0.4.0
│ └─┬ through2#2.0.1
│ ├─┬ readable-stream#2.0.6
│ │ ├── isarray#1.0.0
│ │ ├── process-nextick-args#1.0.7
│ │ └── util-deprecate#1.0.2
│ └── xtend#4.0.1
├── d3-queue#2.0.3
├─┬ optimist#0.3.7
│ └── wordwrap#0.0.3
├── rw#1.3.2
└─┬ shapefile#0.3.1
├── d3-queue#1.2.3
└── iconv-lite#0.2.11
C:\>topojson -v
C:\Users\Seth\AppData\Roaming\npm\node_modules\topojson\bin\topojson:259
if (error) throw error;
^
Error: EISDIR: illegal operation on a directory, read
at Error (native)
at Object.fs.readSync (fs.js:603:19)
at module.exports (C:\Users\Seth\AppData\Roaming\npm\node_modules\topojson\node_modules\rw\lib\rw\read-file-sync.js:14:28)
at Object.readFileSync (C:\Users\Seth\AppData\Roaming\npm\node_modules\topojson\node_modules\rw\lib\rw\dash.js:7:19)
at inputJson (C:\Users\Seth\AppData\Roaming\npm\node_modules\topojson\bin\topojson:245:30)
at start (C:\Users\Seth\AppData\Roaming\npm\node_modules\topojson\node_modules\d3-queue\build\d3-queue.js:68:13)
at poke (C:\Users\Seth\AppData\Roaming\npm\node_modules\topojson\node_modules\d3-queue\build\d3-queue.js:56:26)
at Queue.queue.defer (C:\Users\Seth\AppData\Roaming\npm\node_modules\topojson\node_modules\d3-queue\build\d3-queue.js:34:7)
at C:\Users\Seth\AppData\Roaming\npm\node_modules\topojson\bin\topojson:196:5
at Array.forEach (native)
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
ECONNREFUSED on Port 80
Up until today, my app was working, but then all of a sudden it stopped: it started throwing these errors every time I try to connect to the socket.io-enabled part of the app.
Error: connect ECONNREFUSED
at errnoException (net.js:670:11)
at Object.afterConnect [as oncomplete] (net.js:661:19)
Here are my module version numbers.
CompassionPit#0.5.2 /opt/chat
├── async#0.1.18
├── colors#0.6.0-1
├─┬ connect#2.0.2
│ ├── debug#0.7.0
│ ├── formidable#1.0.9
│ ├── mime#1.2.4
│ └── qs#0.4.2
├── date-utils#1.2.9
├─┬ ecstatic#0.1.6
│ ├── ent#0.0.4
│ └── mime#1.2.5
├─┬ express#2.5.8
│ ├─┬ connect#1.8.7
│ │ ├── formidable#1.0.11
│ │ ├── mime#1.2.5
│ │ └── qs#0.5.0
│ ├── mime#1.2.4
│ ├── mkdirp#0.3.0
│ └── qs#0.4.2
├─┬ flatiron#0.1.17
│ ├─┬ broadway#0.1.15
│ │ ├─┬ cliff#0.1.7
│ │ │ └── eyes#0.1.7
│ │ ├── eventemitter2#0.4.9
│ │ ├─┬ nconf#0.5.1
│ │ │ ├── async#0.1.22
│ │ │ ├── ini#1.0.2
│ │ │ └─┬ optimist#0.3.4
│ │ │ └── wordwrap#0.0.2
│ │ ├─┬ optimist#0.3.1
│ │ │ └── wordwrap#0.0.2
│ │ ├─┬ utile#0.0.10
│ │ │ ├── async#0.1.22
│ │ │ ├── mkdirp#0.3.3
│ │ │ ├── ncp#0.2.6
│ │ │ └── rimraf#1.0.9
│ │ └─┬ winston#0.5.11
│ │ ├── async#0.1.22
│ │ ├── eyes#0.1.7
│ │ ├─┬ loggly#0.3.11
│ │ │ ├── request#2.9.202
│ │ │ └── timespan#2.2.0
│ │ └── stack-trace#0.0.6
│ ├── director#1.0.10
│ ├─┬ optimist#0.3.4
│ │ └── wordwrap#0.0.2
│ ├── pkginfo#0.2.3
│ └─┬ prompt#0.1.12
│ ├── async#0.1.22
│ └─┬ winston#0.5.11
│ ├── async#0.1.22
│ ├── eyes#0.1.7
│ ├─┬ loggly#0.3.11
│ │ ├── request#2.9.202
│ │ └── timespan#2.2.0
│ └── stack-trace#0.0.6
├── geoip#0.4.5
├── hashlib2#1.0.3
├── http-digest#v0.1.0
├─┬ jade#0.20.3
│ ├── commander#0.5.2
│ └── mkdirp#0.3.3
├── marked#0.2.1
├─┬ mongoose#2.5.10
│ ├── hooks#0.2.0
│ └── mongodb#0.9.9-4
├─┬ mysql#0.9.5
│ └─┬ hashish#0.0.4
│ └── traverse#0.6.1
├── nave#0.2.13 extraneous
├─┬ optimist#0.2.8
│ └── wordwrap#0.0.2
├── request#2.1.1
├─┬ socket.io#0.9.0
│ ├── policyfile#0.0.4
│ ├── redis#0.6.7
│ └─┬ socket.io-client#0.9.0
│ ├─┬ ws#0.4.0
│ │ ├── commander#0.5.0
│ │ └── options#0.0.3
│ └── xmlhttprequest#1.2.2
├── sqwish#0.2.0
├── uglify-js#1.2.5
├── underscore#1.3.1
├─┬ union#0.1.8
│ ├── pkginfo#0.2.3
│ └── qs#0.3.2
└─┬ vows#0.5.13
└── eyes#0.1.7
Are you allowing NodeJS to run on port 80? If not you might want to take a look at this: Node.js: ECONNREFUSED on Port 80