How to easily verify correct npm dependencies installed? - node.js

How can I know when to prompt user to run npm install if there are any unmet package.json dependencies?
I would like to do this, because if any require() fails, the user gets a poor error message:
module.js:340
throw err;
^
Error: Cannot find module 'nopt'
I've previously tried to just check for the existence of a node_modules directory, but this only works effectively for fresh git clones. I've also tried just requiring npm and running npm install as part of load, but that is very heavy weight.
I'm hoping there is a lighter weight library out there that just parses package.json and makes sure node_modules contents satisfy the requirements.
One idea was to use process.on('uncaughtException') to catch only module import errors, but looking to see if there is a "standard" solution first.

You can use yarn and do yarn check --verify-tree (you can continue using npm for everything else)

Found this today. Not sure if your still need this.
https://www.npmjs.com/package/check-dependencies
npm install check-dependencies --save-dev
Install this package and save to your package.json.
require('check-dependencies')(config, callback);
config is the following object, which is then passed to the callback.
{
status: number, // 0 if successful, 1 otherwise
depsWereOk: boolean, // true if dependencies were already satisfied
log: array, // array of logged messages
error: array, // array of logged errors
}

npm ls will report missing packages when run from the project folder.
npm-ls documentation
This might have issues if you're using git dependencies, though. (Thanks #gman).

Another solution
function dependenciesNeedUpdating() {
const childProcess = require('child_process');
const result = JSON.parse(childProcess.execSync('npm install --dry-run --json').toString());
return result.added.length > 0 || result.updated.length > 0 || result.removed > 0;
}
Call it like this
if (dependenciesNeedUpdating()) {
console.error('dependencies need updating. Please run `npm install`');
process.exit(1);
}
If you want to install this as a dependency 🤣 its 5 lines are in an npm package here. It adds a ld-check-dependencies command (the 4 usage lines above) so you can use it directly in your npm scripts. Example:
"scripts": {
"build": "ld-check-dependencies && rollup ..."
},
Rationale:
I'm learning that dependencies are a huge liability and should be avoided any time there is a simpler solution.
For example here's is the ridiculous dependency tree for check-dependencies
└─┬ check-dependencies#1.1.0
├─┬ bower-config#1.4.3
│ ├── graceful-fs#4.2.4
│ ├── minimist#0.2.1 extraneous
│ ├── mout#1.2.2
│ ├─┬ osenv#0.1.5
│ │ ├── os-homedir#1.0.2
│ │ └── os-tmpdir#1.0.2
│ ├─┬ untildify#2.1.0
│ │ └── os-homedir#1.0.2 deduped
│ └── wordwrap#0.0.3
├─┬ chalk#2.4.2
│ ├─┬ ansi-styles#3.2.1
│ │ └─┬ color-convert#1.9.3
│ │ └── color-name#1.1.3
│ ├── escape-string-regexp#1.0.5
│ └─┬ supports-color#5.5.0
│ └── has-flag#3.0.0
├─┬ findup-sync#2.0.0
│ ├── detect-file#1.0.0
│ ├─┬ is-glob#3.1.0
│ │ └── is-extglob#2.1.1
│ ├─┬ micromatch#3.1.10
│ │ ├── arr-diff#4.0.0
│ │ ├── array-unique#0.3.2
│ │ ├─┬ braces#2.3.2
│ │ │ ├── arr-flatten#1.1.0
│ │ │ ├── array-unique#0.3.2 deduped
│ │ │ ├── extend-shallow#2.0.1 extraneous
│ │ │ ├─┬ fill-range#4.0.0
│ │ │ │ ├── extend-shallow#2.0.1 extraneous
│ │ │ │ ├─┬ is-number#3.0.0
│ │ │ │ │ └── kind-of#3.2.2 extraneous
│ │ │ │ ├── repeat-string#1.6.1
│ │ │ │ └─┬ to-regex-range#2.1.1
│ │ │ │ ├── is-number#3.0.0 deduped
│ │ │ │ └── repeat-string#1.6.1 deduped
│ │ │ ├── isobject#3.0.1
│ │ │ ├── repeat-element#1.1.3
│ │ │ ├── snapdragon#0.8.2 deduped
│ │ │ ├─┬ snapdragon-node#2.1.1
│ │ │ │ ├── define-property#1.0.0 extraneous
│ │ │ │ ├── isobject#3.0.1 deduped
│ │ │ │ └─┬ snapdragon-util#3.0.1
│ │ │ │ └── kind-of#3.2.2 extraneous
│ │ │ ├─┬ split-string#3.1.0
│ │ │ │ └── extend-shallow#3.0.2 deduped
│ │ │ └── to-regex#3.0.2 deduped
│ │ ├─┬ define-property#2.0.2
│ │ │ ├── is-descriptor#1.0.2 extraneous
│ │ │ └── isobject#3.0.1 deduped
│ │ ├─┬ extend-shallow#3.0.2
│ │ │ ├── assign-symbols#1.0.0
│ │ │ └── is-extendable#1.0.1 extraneous
│ │ ├─┬ extglob#2.0.4
│ │ │ ├── array-unique#0.3.2 deduped
│ │ │ ├── define-property#1.0.0 extraneous
│ │ │ ├─┬ expand-brackets#2.1.4
│ │ │ │ ├── debug#2.6.9 deduped
│ │ │ │ ├── define-property#0.2.5 extraneous
│ │ │ │ ├── extend-shallow#2.0.1 extraneous
│ │ │ │ ├── posix-character-classes#0.1.1
│ │ │ │ ├── regex-not#1.0.2 deduped
│ │ │ │ ├── snapdragon#0.8.2 deduped
│ │ │ │ └── to-regex#3.0.2 deduped
│ │ │ ├── extend-shallow#2.0.1 extraneous
│ │ │ ├── fragment-cache#0.2.1 deduped
│ │ │ ├── regex-not#1.0.2 deduped
│ │ │ ├── snapdragon#0.8.2 deduped
│ │ │ └── to-regex#3.0.2 deduped
│ │ ├─┬ fragment-cache#0.2.1
│ │ │ └── map-cache#0.2.2
│ │ ├── kind-of#6.0.3
│ │ ├─┬ nanomatch#1.2.13
│ │ │ ├── arr-diff#4.0.0 deduped
│ │ │ ├── array-unique#0.3.2 deduped
│ │ │ ├── define-property#2.0.2 deduped
│ │ │ ├── extend-shallow#3.0.2 deduped
│ │ │ ├── fragment-cache#0.2.1 deduped
│ │ │ ├── is-windows#1.0.2
│ │ │ ├── kind-of#6.0.3 deduped
│ │ │ ├── object.pick#1.3.0 deduped
│ │ │ ├── regex-not#1.0.2 deduped
│ │ │ ├── snapdragon#0.8.2 deduped
│ │ │ └── to-regex#3.0.2 deduped
│ │ ├─┬ object.pick#1.3.0
│ │ │ └── isobject#3.0.1 deduped
│ │ ├─┬ regex-not#1.0.2
│ │ │ ├── extend-shallow#3.0.2 deduped
│ │ │ └─┬ safe-regex#1.1.0
│ │ │ └── ret#0.1.15
│ │ ├─┬ snapdragon#0.8.2
│ │ │ ├─┬ base#0.11.2
│ │ │ │ ├─┬ cache-base#1.0.1
│ │ │ │ │ ├─┬ collection-visit#1.0.0
│ │ │ │ │ │ ├─┬ map-visit#1.0.0
│ │ │ │ │ │ │ └── object-visit#1.0.1 deduped
│ │ │ │ │ │ └─┬ object-visit#1.0.1
│ │ │ │ │ │ └── isobject#3.0.1 deduped
│ │ │ │ │ ├── component-emitter#1.3.0 deduped
│ │ │ │ │ ├── get-value#2.0.6
│ │ │ │ │ ├─┬ has-value#1.0.0
│ │ │ │ │ │ ├── get-value#2.0.6 deduped
│ │ │ │ │ │ ├─┬ has-values#1.0.0
│ │ │ │ │ │ │ ├── is-number#3.0.0 deduped
│ │ │ │ │ │ │ └── kind-of#4.0.0 extraneous
│ │ │ │ │ │ └── isobject#3.0.1 deduped
│ │ │ │ │ ├── isobject#3.0.1 deduped
│ │ │ │ │ ├─┬ set-value#2.0.1
│ │ │ │ │ │ ├── extend-shallow#2.0.1 extraneous
│ │ │ │ │ │ ├── is-extendable#0.1.1
│ │ │ │ │ │ ├─┬ is-plain-object#2.0.4
│ │ │ │ │ │ │ └── isobject#3.0.1 deduped
│ │ │ │ │ │ └── split-string#3.1.0 deduped
│ │ │ │ │ ├─┬ to-object-path#0.3.0
│ │ │ │ │ │ └── kind-of#3.2.2 extraneous
│ │ │ │ │ ├─┬ union-value#1.0.1
│ │ │ │ │ │ ├── arr-union#3.1.0 deduped
│ │ │ │ │ │ ├── get-value#2.0.6 deduped
│ │ │ │ │ │ ├── is-extendable#0.1.1 deduped
│ │ │ │ │ │ └── set-value#2.0.1 deduped
│ │ │ │ │ └─┬ unset-value#1.0.0
│ │ │ │ │ ├── has-value#0.3.1 extraneous
│ │ │ │ │ └── isobject#3.0.1 deduped
│ │ │ │ ├─┬ class-utils#0.3.6
│ │ │ │ │ ├── arr-union#3.1.0
│ │ │ │ │ ├── define-property#0.2.5 extraneous
│ │ │ │ │ ├── isobject#3.0.1 deduped
│ │ │ │ │ └─┬ static-extend#0.1.2
│ │ │ │ │ ├── define-property#0.2.5 extraneous
│ │ │ │ │ └─┬ object-copy#0.1.0
│ │ │ │ │ ├── copy-descriptor#0.1.1
│ │ │ │ │ ├── define-property#0.2.5 extraneous
│ │ │ │ │ └── kind-of#3.2.2 extraneous
│ │ │ │ ├── component-emitter#1.3.0
│ │ │ │ ├── define-property#1.0.0 extraneous
│ │ │ │ ├── isobject#3.0.1 deduped
│ │ │ │ ├─┬ mixin-deep#1.3.2
│ │ │ │ │ ├── for-in#1.0.2
│ │ │ │ │ └── is-extendable#1.0.1 extraneous
│ │ │ │ └── pascalcase#0.1.1
│ │ │ ├─┬ debug#2.6.9
│ │ │ │ └── ms#2.0.0
│ │ │ ├── define-property#0.2.5 extraneous
│ │ │ ├── extend-shallow#2.0.1 extraneous
│ │ │ ├── map-cache#0.2.2 deduped
│ │ │ ├── source-map#0.5.7
│ │ │ ├─┬ source-map-resolve#0.5.3
│ │ │ │ ├── atob#2.1.2
│ │ │ │ ├── decode-uri-component#0.2.0
│ │ │ │ ├── resolve-url#0.2.1
│ │ │ │ ├── source-map-url#0.4.0
│ │ │ │ └── urix#0.1.0
│ │ │ └── use#3.1.1
│ │ └─┬ to-regex#3.0.2
│ │ ├── define-property#2.0.2 deduped
│ │ ├── extend-shallow#3.0.2 deduped
│ │ ├── regex-not#1.0.2 deduped
│ │ └── safe-regex#1.1.0 deduped
│ └─┬ resolve-dir#1.0.1
│ ├─┬ expand-tilde#2.0.2
│ │ └─┬ homedir-polyfill#1.0.3
│ │ └── parse-passwd#1.0.0
│ └─┬ global-modules#1.0.0
│ ├─┬ global-prefix#1.0.2
│ │ ├── expand-tilde#2.0.2 deduped
│ │ ├── homedir-polyfill#1.0.3 deduped
│ │ ├── ini#1.3.5
│ │ ├── is-windows#1.0.2 deduped
│ │ └─┬ which#1.3.1
│ │ └── isexe#2.0.0
│ ├── is-windows#1.0.2 deduped
│ └── resolve-dir#1.0.1 deduped
├── lodash.camelcase#4.3.0
├── minimist#1.2.5
└── semver#5.7.1
788 js files and 48000 lines of code.
Everyone one of those dependencies is another chance for you to be told something is broke, deprecated, there's a new vulnerability, etc. Basically by using something with so many dependencies you're adding to your workload when you could instead be spending time shipping, dancing, playing with your kids, whatever. You thought you were saving time by using a dependency but if it's got so many dependencies than you're not saving time if you compare to a lower or simple no dependency option because you will be forever dealing with the issues of those dependencies.
Here's the dependency tree for deps-ok which is much more reasonable.
└─┬ deps-ok#1.4.1
├── check-more-types#2.24.0
├─┬ debug#3.1.0
│ └── ms#2.0.0
├── lazy-ass#1.6.0
├── lodash#4.17.10
├── minimist#1.2.0
├─┬ q#2.0.3
│ ├── asap#2.0.6
│ ├── pop-iterate#1.0.1
│ └── weak-map#1.0.5
├── quote#0.4.0
└── semver#5.5.0
But it still manages to demonstrate the problem with dependencies
❯ npm audit
=== npm audit security report ===
┌──────────────────────────────────────────────────────────────────────────────┐
│ Manual Review │
│ Some vulnerabilities require your attention to resolve │
│ │
│ Visit https://go.npm.me/audit-guide for additional guidance │
└──────────────────────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High │ Prototype Pollution │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ lodash │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=4.17.11 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ deps-ok │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ deps-ok > lodash │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://npmjs.com/advisories/782 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High │ Prototype Pollution │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ lodash │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=4.17.12 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ deps-ok │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ deps-ok > lodash │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://npmjs.com/advisories/1065 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low │ Prototype Pollution │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ lodash │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=4.17.19 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ deps-ok │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ deps-ok > lodash │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://npmjs.com/advisories/1523 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low │ Prototype Pollution │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ minimist │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=0.2.1 <1.0.0 || >=1.2.3 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ deps-ok │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ deps-ok > minimist │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://npmjs.com/advisories/1179 │
└───────────────┴──────────────────────────────────────────────────────────────┘
found 4 vulnerabilities (2 low, 2 high) in 13 scanned packages
4 vulnerabilities require manual review. See the full report for details.
Now of course maybe you don't care about those vulnerabilities because this script is only used during building but now you have a new problem that any real vulnerabilities will be buried in these ones you don't care about.
I have no idea how robust or comprehensive the solution above is. The good thing is it relies on npm so whatever npm install is going to do it's doing that exact thing.

Not sure there is npm way to do it, but just found this seems helpful:
blog post: http://bahmutov.calepin.co/check-dependencies-in-grunt-by-default.html
project: https://github.com/bahmutov/deps-ok

Related

Issue integrating Firebase Cloud Functions

I want to use Firebase Cloud Functions in my APP. So for that I have installed "node-v6.17.1.pkg" from official site.
After installing I run "npm install -g firebase-tools" that brought permission error SO I run "sudo npm install -g firebase-tools" and it may be successfully installed.
Output like
/Users/ipatel/.npm-global/bin/firebase -> /Users/ipatel/.npm-global/lib/node_modules/firebase-tools/lib/bin/firebase.js
#google-cloud/functions-emulator#1.0.0-beta.5 postinstall /Users/ipatel/.npm-global/lib/node_modules/firebase-tools/node_modules/#google-cloud/functions-emulator
node scripts/upgrade-warning
If you're using the Emulator via the Firebase CLI, you can
disregard this message.
If you're upgrading #google-cloud/functions-emulator, these
are the recommended upgrade steps:
Stop the currently running emulator, if any:
functions stop
Uninstall the current emulator, if any:
npm uninstall -g #google-cloud/functions-emulator
Install the new version of the emulator:
npm install -g #google-cloud/functions-emulator
If you have trouble after upgrading, try deleting the config
directory found in:
~/.config/configstore/#google-cloud/functions-emulator
Then restart the emulator. You can also check for any renegade
Node.js emulator processes that may need to be killed:
ps aux | grep node
/Users/ipatel/.npm-global/lib
└─┬ firebase-tools#6.6.0
├─┬ #google-cloud/functions-emulator#1.0.0-beta.5
│ ├─┬ #google-cloud/storage#1.7.0
│ │ ├─┬ #google-cloud/common#0.17.0
│ │ │ ├── array-uniq#1.0.3
│ │ │ ├── ent#2.2.0
│ │ │ ├─┬ google-auto-auth#0.10.1
│ │ │ │ ├─┬ gcp-metadata#0.6.3
│ │ │ │ │ ├─┬ axios#0.18.0
│ │ │ │ │ │ ├── follow-redirects#1.7.0
│ │ │ │ │ │ └── is-buffer#1.1.6
│ │ │ │ │ └── retry-axios#0.3.2
│ │ │ │ └─┬ google-auth-library#1.6.1
│ │ │ │ └─┬ gtoken#2.3.3
│ │ │ │ ├─┬ gaxios#1.8.3
│ │ │ │ │ ├─┬ abort-controller#3.0.0
│ │ │ │ │ │ └── event-target-shim#5.0.1
│ │ │ │ │ ├─┬ https-proxy-agent#2.2.1
│ │ │ │ │ │ └─┬ agent-base#4.2.1
│ │ │ │ │ │ └─┬ es6-promisify#5.0.0
│ │ │ │ │ │ └── es6-promise#4.2.6
│ │ │ │ │ └── node-fetch#2.3.0
│ │ │ │ ├─┬ google-p12-pem#1.0.4
│ │ │ │ │ └── node-forge#0.8.2
│ │ │ │ └── pify#4.0.1
│ │ │ ├── log-driver#1.2.7
│ │ │ ├── methmeth#1.1.0
│ │ │ ├── modelo#4.2.3
│ │ │ ├─┬ split-array-stream#1.0.3
│ │ │ │ └── is-stream-ended#0.1.4
│ │ │ └── string-format-obj#1.1.1
│ │ ├── arrify#1.0.1
│ │ ├── compressible#2.0.16
│ │ ├─┬ concat-stream#1.6.2
│ │ │ ├── buffer-from#1.1.1
│ │ │ └── typedarray#0.0.6
│ │ ├─┬ create-error-class#3.0.2
│ │ │ └── capture-stack-trace#1.0.1
│ │ ├─┬ duplexify#3.7.1
│ │ │ └── stream-shift#1.0.0
│ │ ├─┬ gcs-resumable-upload#0.10.2
│ │ │ ├── configstore#3.1.2
│ │ │ └── google-auto-auth#0.10.1
│ │ ├── hash-stream-validation#0.2.1
│ │ ├── mime#2.4.2
│ │ ├─┬ pumpify#1.5.1
│ │ │ └── pump#2.0.1
│ │ ├── snakeize#0.1.0
│ │ ├─┬ stream-events#1.0.5
│ │ │ └── stubs#3.0.0
│ │ └── through2#2.0.5
│ ├── adm-zip#0.4.13
│ ├─┬ ajv#6.10.0
│ │ ├── fast-deep-equal#2.0.1
│ │ ├── fast-json-stable-stringify#2.0.0
│ │ ├── json-schema-traverse#0.4.1
│ │ └─┬ uri-js#4.2.2
│ │ └── punycode#2.1.1
│ ├─┬ body-parser#1.18.3
│ │ ├── bytes#3.0.0
│ │ ├── content-type#1.0.4
│ │ ├─┬ debug#2.6.9
│ │ │ └── ms#2.0.0
│ │ ├── depd#1.1.2
│ │ ├─┬ http-errors#1.6.3
│ │ │ └── statuses#1.5.0
│ │ ├─┬ iconv-lite#0.4.23
│ │ │ └── safer-buffer#2.1.2
│ │ ├─┬ raw-body#2.3.3
│ │ │ └── unpipe#1.0.0
│ │ └─┬ type-is#1.6.16
│ │ └── media-typer#0.3.0
│ ├─┬ cli-table2#0.2.0
│ │ └── lodash#3.10.1
│ ├── colors#1.1.2
│ ├─┬ configstore#3.1.2
│ │ ├─┬ dot-prop#4.2.0
│ │ │ └── is-obj#1.0.1
│ │ ├─┬ make-dir#1.3.0
│ │ │ └── pify#3.0.0
│ │ ├─┬ unique-string#1.0.0
│ │ │ └── crypto-random-string#1.0.0
│ │ └─┬ write-file-atomic#2.4.2
│ │ └── signal-exit#3.0.2
│ ├─┬ express#4.16.4
│ │ ├─┬ accepts#1.3.5
│ │ │ └── negotiator#0.6.1
│ │ ├── array-flatten#1.1.1
│ │ ├── content-disposition#0.5.2
│ │ ├── cookie#0.3.1
│ │ ├── cookie-signature#1.0.6
│ │ ├─┬ debug#2.6.9
│ │ │ └── ms#2.0.0
│ │ ├── encodeurl#1.0.2
│ │ ├── escape-html#1.0.3
│ │ ├── etag#1.8.1
│ │ ├─┬ finalhandler#1.1.1
│ │ │ ├─┬ debug#2.6.9
│ │ │ │ └── ms#2.0.0
│ │ │ └── statuses#1.4.0
│ │ ├── fresh#0.5.2
│ │ ├── merge-descriptors#1.0.1
│ │ ├── methods#1.1.2
│ │ ├── parseurl#1.3.2
│ │ ├── path-to-regexp#0.1.7
│ │ ├─┬ proxy-addr#2.0.4
│ │ │ ├── forwarded#0.1.2
│ │ │ └── ipaddr.js#1.8.0
│ │ ├── range-parser#1.2.0
│ │ ├─┬ send#0.16.2
│ │ │ ├── debug#2.6.9
│ │ │ ├── mime#1.4.1
│ │ │ ├── ms#2.0.0
│ │ │ └── statuses#1.4.0
│ │ ├── serve-static#1.13.2
│ │ ├── setprototypeof#1.1.0
│ │ ├── statuses#1.4.0
│ │ ├── utils-merge#1.0.1
│ │ └── vary#1.1.2
│ ├─┬ googleapis#23.0.2
│ │ ├── async#2.6.0
│ │ ├─┬ google-auth-library#0.12.0
│ │ │ ├─┬ gtoken#1.2.3
│ │ │ │ ├─┬ google-p12-pem#0.1.2
│ │ │ │ │ └── node-forge#0.7.6
│ │ │ │ └── mime#1.6.0
│ │ │ └── lodash.merge#4.6.1
│ │ └── string-template#1.0.0
│ ├─┬ got#8.3.2
│ │ ├── #sindresorhus/is#0.7.0
│ │ ├─┬ cacheable-request#2.1.4
│ │ │ ├── clone-response#1.0.2
│ │ │ ├── http-cache-semantics#3.8.1
│ │ │ ├─┬ keyv#3.0.0
│ │ │ │ └── json-buffer#3.0.0
│ │ │ ├── lowercase-keys#1.0.0
│ │ │ ├─┬ normalize-url#2.0.1
│ │ │ │ ├─┬ query-string#5.1.1
│ │ │ │ │ ├── decode-uri-component#0.2.0
│ │ │ │ │ └── strict-uri-encode#1.1.0
│ │ │ │ └─┬ sort-keys#2.0.0
│ │ │ │ └── is-plain-obj#1.1.0
│ │ │ └── responselike#1.0.2
│ │ ├── decompress-response#3.3.0
│ │ ├── duplexer3#0.1.4
│ │ ├── get-stream#3.0.0
│ │ ├─┬ into-stream#3.1.0
│ │ │ ├── from2#2.3.0
│ │ │ └── p-is-promise#1.1.0
│ │ ├── is-retry-allowed#1.1.0
│ │ ├─┬ isurl#1.0.0
│ │ │ ├─┬ has-to-string-tag-x#1.4.1
│ │ │ │ └── has-symbol-support-x#1.4.2
│ │ │ └── is-object#1.0.1
│ │ ├── lowercase-keys#1.0.1
│ │ ├── mimic-response#1.0.1
│ │ ├── p-cancelable#0.4.1
│ │ ├─┬ p-timeout#2.0.1
│ │ │ └── p-finally#1.0.0
│ │ ├── pify#3.0.0
│ │ ├── timed-out#4.0.1
│ │ ├─┬ url-parse-lax#3.0.0
│ │ │ └── prepend-http#2.0.0
│ │ └── url-to-options#1.0.1
│ ├─┬ http-proxy#1.16.2
│ │ ├── eventemitter3#1.2.0
│ │ └── requires-port#1.0.0
│ ├── lodash#4.17.5
│ ├─┬ prompt#1.0.0
│ │ ├── pkginfo#0.4.1
│ │ ├─┬ read#1.0.7
│ │ │ └── mute-stream#0.0.8
│ │ ├── revalidator#0.1.8
│ │ ├─┬ utile#0.3.0
│ │ │ ├── async#0.9.2
│ │ │ ├── deep-equal#0.2.2
│ │ │ ├── i#0.3.6
│ │ │ └── ncp#1.0.1
│ │ └─┬ winston#2.1.1
│ │ ├── async#1.0.0
│ │ ├── colors#1.0.3
│ │ └── pkginfo#0.3.1
│ ├── rimraf#2.6.2
│ ├── semver#5.5.0
│ ├─┬ serializerr#1.0.3
│ │ └── protochain#1.0.5
│ ├── uuid#3.2.1
│ ├─┬ winston#2.4.0
│ │ ├── async#1.0.0
│ │ └── colors#1.0.3
│ └─┬ yargs#11.0.0
│ ├─┬ cliui#4.1.0
│ │ ├─┬ string-width#2.1.1
│ │ │ └── is-fullwidth-code-point#2.0.0
│ │ ├─┬ strip-ansi#4.0.0
│ │ │ └── ansi-regex#3.0.0
│ │ └── wrap-ansi#2.1.0
│ ├── decamelize#1.2.0
│ ├─┬ find-up#2.1.0
│ │ └─┬ locate-path#2.0.0
│ │ ├─┬ p-locate#2.0.0
│ │ │ └─┬ p-limit#1.3.0
│ │ │ └── p-try#1.0.0
│ │ └── path-exists#3.0.0
│ ├── get-caller-file#1.0.3
│ ├─┬ os-locale#2.1.0
│ │ ├─┬ execa#0.7.0
│ │ │ ├── cross-spawn#5.1.0
│ │ │ ├── is-stream#1.1.0
│ │ │ ├── npm-run-path#2.0.2
│ │ │ └── strip-eof#1.0.0
│ │ ├─┬ lcid#1.0.0
│ │ │ └── invert-kv#1.0.0
│ │ └─┬ mem#1.1.0
│ │ └── mimic-fn#1.2.0
│ ├── require-directory#2.1.1
│ ├── require-main-filename#1.0.1
│ ├── set-blocking#2.0.0
│ ├─┬ string-width#2.1.1
│ │ ├── is-fullwidth-code-point#2.0.0
│ │ └─┬ strip-ansi#4.0.0
│ │ └── ansi-regex#3.0.0
│ ├── which-module#2.0.0
│ ├── y18n#3.2.1
│ └── yargs-parser#9.0.2
├─┬ archiver#2.1.1
│ ├─┬ archiver-utils#1.3.0
│ │ ├── lazystream#1.0.0
│ │ └─┬ normalize-path#2.1.1
│ │ └── remove-trailing-separator#1.1.0
│ ├── async#2.6.2
│ ├── buffer-crc32#0.2.13
│ ├─┬ readable-stream#2.3.6
│ │ ├── core-util-is#1.0.2
│ │ ├── isarray#1.0.0
│ │ ├── process-nextick-args#2.0.0
│ │ ├── string_decoder#1.1.1
│ │ └── util-deprecate#1.0.2
│ ├─┬ tar-stream#1.6.2
│ │ ├── bl#1.2.2
│ │ ├─┬ buffer-alloc#1.2.0
│ │ │ ├── buffer-alloc-unsafe#1.1.0
│ │ │ └── buffer-fill#1.0.0
│ │ ├── end-of-stream#1.4.1
│ │ ├── fs-constants#1.0.0
│ │ ├── to-buffer#1.1.1
│ │ └── xtend#4.0.1
│ └─┬ zip-stream#1.2.0
│ └─┬ compress-commons#1.2.2
│ └─┬ crc32-stream#2.0.0
│ └─┬ crc#3.8.0
│ └─┬ buffer#5.2.1
│ ├── base64-js#1.3.0
│ └── ieee754#1.1.13
├─┬ cjson#0.3.3
│ └─┬ json-parse-helpfulerror#1.0.3
│ └── jju#1.4.0
├─┬ cli-color#1.4.0
│ ├── ansi-regex#2.1.1
│ ├── d#1.0.0
│ ├─┬ es5-ext#0.10.49
│ │ └── next-tick#1.0.0
│ ├── es6-iterator#2.0.3
│ ├─┬ memoizee#0.4.14
│ │ ├── es6-weak-map#2.0.2
│ │ ├── is-promise#2.1.0
│ │ └── lru-queue#0.1.0
│ └── timers-ext#0.1.7
├─┬ cli-table#0.3.1
│ └── colors#1.0.3
├── commander#2.20.0
├─┬ configstore#1.4.0
│ ├── graceful-fs#4.1.15
│ ├─┬ mkdirp#0.5.1
│ │ └── minimist#0.0.8
│ ├── object-assign#4.1.1
│ ├── os-tmpdir#1.0.2
│ ├── osenv#0.1.5
│ ├── uuid#2.0.3
│ ├─┬ write-file-atomic#1.3.4
│ │ ├── imurmurhash#0.1.4
│ │ └── slide#1.1.6
│ └── xdg-basedir#2.0.0
├─┬ cross-env#5.2.0
│ ├─┬ cross-spawn#6.0.5
│ │ ├── nice-try#1.0.5
│ │ ├── path-key#2.0.1
│ │ └─┬ shebang-command#1.2.0
│ │ └── shebang-regex#1.0.0
│ └── is-windows#1.0.2
├─┬ cross-spawn#4.0.2
│ ├─┬ lru-cache#4.1.5
│ │ ├── pseudomap#1.0.2
│ │ └── yallist#2.1.2
│ └─┬ which#1.3.1
│ └── isexe#2.0.0
├─┬ csv-streamify#3.0.4
│ └─┬ through2#2.0.1
│ └─┬ readable-stream#2.0.6
│ ├── process-nextick-args#1.0.7
│ └── string_decoder#0.10.31
├── didyoumean#1.2.1
├─┬ es6-set#0.1.5
│ ├── es6-symbol#3.1.1
│ └── event-emitter#0.3.5
├── exit-code#1.0.2
├── filesize#3.6.1
├─┬ firebase#2.4.2
│ └─┬ faye-websocket#0.9.3
│ └─┬ websocket-driver#0.5.2
│ └── websocket-extensions#0.1.1
├─┬ fs-extra#0.23.1
│ ├── jsonfile#2.4.0
│ └── path-is-absolute#1.0.1
├─┬ glob#7.1.3
│ ├── fs.realpath#1.0.0
│ ├─┬ inflight#1.0.6
│ │ └── wrappy#1.0.2
│ ├── inherits#2.0.3
│ └── once#1.4.0
├─┬ google-auto-auth#0.7.2
│ ├─┬ gcp-metadata#0.3.1
│ │ └── retry-request#3.3.2
│ └─┬ google-auth-library#0.10.0
│ ├─┬ gtoken#1.2.3
│ │ ├─┬ google-p12-pem#0.1.2
│ │ │ └── node-forge#0.7.6
│ │ └── mime#1.6.0
│ └── lodash.noop#3.0.1
├─┬ inquirer#0.12.0
│ ├── ansi-escapes#1.4.0
│ ├─┬ 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
│ ├─┬ cli-cursor#1.0.2
│ │ └─┬ restore-cursor#1.0.1
│ │ ├── exit-hook#1.1.1
│ │ └── onetime#1.1.0
│ ├── cli-width#2.2.0
│ ├── figures#1.7.0
│ ├─┬ readline2#1.0.1
│ │ ├── code-point-at#1.1.0
│ │ ├─┬ is-fullwidth-code-point#1.0.0
│ │ │ └── number-is-nan#1.0.1
│ │ └── mute-stream#0.0.5
│ ├── run-async#0.1.0
│ ├── rx-lite#3.1.2
│ ├── string-width#1.0.2
│ └── strip-ansi#3.0.1
├── is#3.3.0
├── jsonschema#1.2.4
├─┬ JSONStream#1.3.5
│ ├── jsonparse#1.3.1
│ └── through#2.3.8
├─┬ jsonwebtoken#8.5.1
│ ├─┬ jws#3.2.2
│ │ └─┬ jwa#1.4.1
│ │ ├── buffer-equal-constant-time#1.0.1
│ │ └── ecdsa-sig-formatter#1.0.11
│ ├── lodash.includes#4.3.0
│ ├── lodash.isboolean#3.0.3
│ ├── lodash.isinteger#4.0.4
│ ├── lodash.isnumber#3.0.3
│ ├── lodash.isplainobject#4.0.6
│ ├── lodash.isstring#4.0.1
│ ├── lodash.once#4.1.1
│ └── ms#2.1.1
├── lodash#4.17.11
├─┬ minimatch#3.0.4
│ └─┬ brace-expansion#1.1.11
│ ├── balanced-match#1.0.0
│ └── concat-map#0.0.1
├─┬ opn#5.5.0
│ └── is-wsl#1.1.0
├─┬ ora#0.2.3
│ └── cli-spinners#0.1.2
├─┬ portfinder#1.0.20
│ ├── async#1.5.2
│ └─┬ debug#2.6.9
│ └── ms#2.0.0
├── progress#2.0.3
├─┬ request#2.88.0
│ ├── aws-sign2#0.7.0
│ ├── aws4#1.8.0
│ ├── caseless#0.12.0
│ ├─┬ combined-stream#1.0.7
│ │ └── delayed-stream#1.0.0
│ ├── extend#3.0.2
│ ├── forever-agent#0.6.1
│ ├─┬ form-data#2.3.3
│ │ └── asynckit#0.4.0
│ ├─┬ har-validator#5.1.3
│ │ └── har-schema#2.0.0
│ ├─┬ http-signature#1.2.0
│ │ ├── assert-plus#1.0.0
│ │ ├─┬ jsprim#1.4.1
│ │ │ ├── extsprintf#1.3.0
│ │ │ ├── json-schema#0.2.3
│ │ │ └── verror#1.10.0
│ │ └─┬ sshpk#1.16.1
│ │ ├── asn1#0.2.4
│ │ ├── bcrypt-pbkdf#1.0.2
│ │ ├── dashdash#1.14.1
│ │ ├── ecc-jsbn#0.1.2
│ │ ├── getpass#0.1.7
│ │ ├── jsbn#0.1.1
│ │ └── tweetnacl#0.14.5
│ ├── is-typedarray#1.0.0
│ ├── isstream#0.1.2
│ ├── json-stringify-safe#5.0.1
│ ├─┬ mime-types#2.1.22
│ │ └── mime-db#1.38.0
│ ├── oauth-sign#0.9.0
│ ├── performance-now#2.1.0
│ ├── qs#6.5.2
│ ├── safe-buffer#5.1.2
│ ├─┬ tough-cookie#2.4.3
│ │ ├── psl#1.1.31
│ │ └── punycode#1.4.1
│ └── tunnel-agent#0.6.0
├── semver#5.7.0
├─┬ superstatic#6.0.4
│ ├── as-array#2.0.0
│ ├── async#1.5.2
│ ├── basic-auth-connect#1.0.0
│ ├── char-spinner#1.0.1
│ ├── compare-semver#1.1.0
│ ├─┬ compression#1.7.4
│ │ └─┬ debug#2.6.9
│ │ └── ms#2.0.0
│ ├─┬ connect#3.6.6
│ │ ├─┬ debug#2.6.9
│ │ │ └── ms#2.0.0
│ │ └─┬ finalhandler#1.1.0
│ │ └── statuses#1.3.1
│ ├─┬ connect-query#1.0.0
│ │ └── qs#6.4.0
│ ├── destroy#1.0.4
│ ├─┬ fast-url-parser#1.1.3
│ │ └── punycode#1.4.1
│ ├─┬ fs-extra#0.30.0
│ │ └── klaw#1.3.1
│ ├─┬ glob-slasher#1.0.1
│ │ ├── glob-slash#1.0.0
│ │ ├─┬ lodash.isobject#2.4.1
│ │ │ └── lodash._objecttypes#2.4.1
│ │ └── toxic#1.0.1
│ ├── home-dir#1.0.0
│ ├── is-url#1.2.4
│ ├─┬ join-path#1.1.1
│ │ ├── url-join#0.0.1
│ │ └── valid-url#1.0.9
│ ├─┬ morgan#1.9.1
│ │ ├── basic-auth#2.0.1
│ │ └─┬ debug#2.6.9
│ │ └── ms#2.0.0
│ ├─┬ nash#3.0.0
│ │ ├── async#1.5.2
│ │ ├─┬ flat-arguments#1.0.2
│ │ │ ├─┬ as-array#1.0.0
│ │ │ │ ├── lodash.isarguments#2.4.1
│ │ │ │ ├── lodash.isobject#2.4.1
│ │ │ │ └─┬ lodash.values#2.4.1
│ │ │ │ └─┬ lodash.keys#2.4.1
│ │ │ │ ├── lodash._isnative#2.4.1
│ │ │ │ └── lodash._shimkeys#2.4.1
│ │ │ ├── lodash.isarguments#3.1.0
│ │ │ └── lodash.isobject#3.0.2
│ │ └── minimist#1.2.0
│ ├─┬ on-finished#2.3.0
│ │ └── ee-first#1.1.1
│ ├── on-headers#1.0.2
│ ├─┬ path-to-regexp#1.7.0
│ │ └── isarray#0.0.1
│ ├─┬ router#1.3.3
│ │ ├── array-flatten#2.1.1
│ │ └─┬ debug#2.6.9
│ │ └── ms#2.0.0
│ ├── rsvp#3.6.2
│ ├── string-length#1.0.1
│ └── try-require#1.2.1
├─┬ tar#4.4.8
│ ├── chownr#1.1.1
│ ├── fs-minipass#1.2.5
│ ├─┬ minipass#2.3.5
│ │ └── yallist#3.0.3
│ ├── minizlib#1.2.1
│ └── yallist#3.0.3
├── tmp#0.0.33
├─┬ universal-analytics#0.4.20
│ └── debug#3.2.6
├─┬ update-notifier#2.5.0
│ ├─┬ boxen#1.3.0
│ │ ├─┬ ansi-align#2.0.0
│ │ │ └─┬ string-width#2.1.1
│ │ │ ├── is-fullwidth-code-point#2.0.0
│ │ │ └─┬ strip-ansi#4.0.0
│ │ │ └── ansi-regex#3.0.0
│ │ ├── camelcase#4.1.0
│ │ ├─┬ chalk#2.4.2
│ │ │ ├── ansi-styles#3.2.1
│ │ │ └── supports-color#5.5.0
│ │ ├── cli-boxes#1.0.0
│ │ ├─┬ string-width#2.1.1
│ │ │ ├── is-fullwidth-code-point#2.0.0
│ │ │ └─┬ strip-ansi#4.0.0
│ │ │ └── ansi-regex#3.0.0
│ │ ├── term-size#1.2.0
│ │ └─┬ widest-line#2.0.1
│ │ └─┬ string-width#2.1.1
│ │ ├── is-fullwidth-code-point#2.0.0
│ │ └─┬ strip-ansi#4.0.0
│ │ └── ansi-regex#3.0.0
│ ├─┬ chalk#2.4.2
│ │ ├─┬ ansi-styles#3.2.1
│ │ │ └─┬ color-convert#1.9.3
│ │ │ └── color-name#1.1.3
│ │ └─┬ supports-color#5.5.0
│ │ └── has-flag#3.0.0
│ ├── configstore#3.1.2
│ ├── import-lazy#2.1.0
│ ├─┬ is-ci#1.2.1
│ │ └── ci-info#1.6.0
│ ├─┬ is-installed-globally#0.1.0
│ │ ├─┬ global-dirs#0.1.1
│ │ │ └── ini#1.3.5
│ │ └─┬ is-path-inside#1.0.1
│ │ └── path-is-inside#1.0.2
│ ├── is-npm#1.0.0
│ ├─┬ latest-version#3.1.0
│ │ └─┬ package-json#4.0.1
│ │ ├─┬ got#6.7.1
│ │ │ ├── is-redirect#1.0.0
│ │ │ ├── unzip-response#2.0.1
│ │ │ └─┬ url-parse-lax#1.0.0
│ │ │ └── prepend-http#1.0.4
│ │ ├─┬ registry-auth-token#3.4.0
│ │ │ └─┬ rc#1.2.8
│ │ │ ├── deep-extend#0.6.0
│ │ │ ├── minimist#1.2.0
│ │ │ └── strip-json-comments#2.0.1
│ │ └── registry-url#3.1.0
│ ├── semver-diff#2.1.0
│ └── xdg-basedir#3.0.0
├─┬ user-home#2.0.0
│ └── os-homedir#1.0.2
├── uuid#3.3.2
└─┬ winston#1.1.2
├── async#1.0.0
├── colors#1.0.3
├── cycle#1.0.3
├── eyes#0.1.8
├── pkginfo#0.3.1
└── stack-trace#0.0.10
Might be success in install! BUT
Issue is When I'm trying to run "firebase login" any other "firebase" command that It give me error like
-bash: firebase: command not found
Any setup I required? Guide me.

Jhipster : cannot use jhipster-generator

I want to try new version of jhipster but i am not able to generate a sample project. I have a jhipster error :
I install npm, yo, bower, generator-jhipster as suggested in the Jhipster documentation.
generator-jhipster installation :
npm install -g generator-jhipster
/Users/myuser/npm/bin/jhipster -> /Users/myuser/npm/lib/node_modules/generator-jhipster/cli/jhipster.js
> generator-jhipster#4.6.2 install /Users/myuser/npm/lib/node_modules/generator-jhipster
> tabtab install --name jhipster --auto
tabtab:installer Installing completion script to bashrc directory +0ms
tabtab:installer Installing completion script to /Users/myuser/.bashrc directory +6ms
tabtab:installer Writing to /Users/myuser/.bashrc file in append mode +1ms
tabtab:installer Writing actual completion script to /Users/myuser/npm/lib/node_modules/generator-jhipster/node_modules/tabtab/.completions/jhipster.bash +1ms
tabtab:installer Already installed jhipster in /Users/myuser/.bashrc +3ms
> spawn-sync#1.0.15 postinstall /Users/myuser/npm/lib/node_modules/generator-jhipster/node_modules/spawn-sync
> node postinstall
/Users/myuser/npm/lib
└─┬ generator-jhipster#4.6.2
├─┬ chalk#2.0.1
│ ├─┬ ansi-styles#3.2.0
│ │ └─┬ color-convert#1.9.0
│ │ └── color-name#1.1.3
│ ├── escape-string-regexp#1.0.5
│ └─┬ supports-color#4.2.1
│ └── has-flag#2.0.0
├─┬ cheerio#0.22.0
│ ├─┬ css-select#1.2.0
│ │ ├── boolbase#1.0.0
│ │ ├── css-what#2.1.0
│ │ ├── domutils#1.5.1
│ │ └── nth-check#1.0.1
│ ├─┬ dom-serializer#0.1.0
│ │ └── domelementtype#1.1.3
│ ├── entities#1.1.1
│ ├─┬ htmlparser2#3.9.2
│ │ ├── domelementtype#1.3.0
│ │ ├── domhandler#2.4.1
│ │ └─┬ readable-stream#2.3.3
│ │ ├── core-util-is#1.0.2
│ │ ├── isarray#1.0.0
│ │ ├── process-nextick-args#1.0.7
│ │ ├── string_decoder#1.0.3
│ │ └── util-deprecate#1.0.2
│ ├── lodash.assignin#4.2.0
│ ├── lodash.bind#4.2.1
│ ├── lodash.defaults#4.2.0
│ ├── lodash.filter#4.6.0
│ ├── lodash.flatten#4.4.0
│ ├── lodash.foreach#4.5.0
│ ├── lodash.map#4.6.0
│ ├── lodash.merge#4.6.0
│ ├── lodash.pick#4.4.0
│ ├── lodash.reduce#4.6.0
│ ├── lodash.reject#4.6.0
│ └── lodash.some#4.6.0
├─┬ commander#2.10.0
│ └── graceful-readlink#1.0.1
├── didyoumean#1.2.1
├── ejs#2.5.6
├─┬ glob#7.1.2
│ ├── fs.realpath#1.0.0
│ ├─┬ inflight#1.0.6
│ │ └── wrappy#1.0.2
│ ├── inherits#2.0.3
│ ├─┬ minimatch#3.0.4
│ │ └─┬ brace-expansion#1.1.8
│ │ ├── balanced-match#1.0.0
│ │ └── concat-map#0.0.1
│ ├── once#1.4.0
│ └── path-is-absolute#1.0.1
├─┬ html-wiring#1.2.0
│ ├─┬ cheerio#0.19.0
│ │ ├─┬ css-select#1.0.0
│ │ │ ├── css-what#1.0.0
│ │ │ └── domutils#1.4.3
│ │ ├─┬ htmlparser2#3.8.3
│ │ │ ├── domhandler#2.3.0
│ │ │ ├── domutils#1.5.1
│ │ │ ├── entities#1.0.0
│ │ │ └─┬ readable-stream#1.1.14
│ │ │ ├── isarray#0.0.1
│ │ │ └── string_decoder#0.10.31
│ │ └── lodash#3.10.1
│ └─┬ detect-newline#1.0.3
│ └── get-stdin#4.0.1
├─┬ insight#0.8.4
│ ├── async#1.5.2
│ ├─┬ chalk#1.1.3
│ │ ├── ansi-styles#2.2.1
│ │ ├── has-ansi#2.0.0
│ │ └── supports-color#2.0.0
│ ├─┬ configstore#1.4.0
│ │ ├── graceful-fs#4.1.11
│ │ ├── os-tmpdir#1.0.2
│ │ ├── osenv#0.1.4
│ │ ├── uuid#2.0.3
│ │ ├─┬ write-file-atomic#1.3.4
│ │ │ ├── imurmurhash#0.1.4
│ │ │ └── slide#1.1.6
│ │ └── xdg-basedir#2.0.0
│ ├─┬ inquirer#0.10.1
│ │ ├── ansi-escapes#1.4.0
│ │ ├── ansi-regex#2.1.1
│ │ ├─┬ chalk#1.1.3
│ │ │ ├── ansi-styles#2.2.1
│ │ │ └── supports-color#2.0.0
│ │ ├─┬ cli-cursor#1.0.2
│ │ │ └─┬ restore-cursor#1.0.1
│ │ │ ├── exit-hook#1.1.1
│ │ │ └── onetime#1.1.0
│ │ ├── cli-width#1.1.1
│ │ ├── figures#1.7.0
│ │ ├── lodash#3.10.1
│ │ ├─┬ readline2#1.0.1
│ │ │ ├── code-point-at#1.1.0
│ │ │ ├─┬ is-fullwidth-code-point#1.0.0
│ │ │ │ └── number-is-nan#1.0.1
│ │ │ └── mute-stream#0.0.5
│ │ ├── run-async#0.1.0
│ │ ├── rx-lite#3.1.2
│ │ ├── strip-ansi#3.0.1
│ │ └── through#2.3.8
│ ├─┬ lodash.debounce#3.1.1
│ │ └── lodash._getnative#3.9.1
│ ├── object-assign#4.1.1
│ ├─┬ os-name#1.0.3
│ │ ├── osx-release#1.1.0
│ │ └── win-release#1.1.1
│ ├─┬ request#2.81.0
│ │ ├── aws-sign2#0.6.0
│ │ ├── aws4#1.6.0
│ │ ├── caseless#0.12.0
│ │ ├─┬ combined-stream#1.0.5
│ │ │ └── delayed-stream#1.0.0
│ │ ├── extend#3.0.1
│ │ ├── forever-agent#0.6.1
│ │ ├─┬ form-data#2.1.4
│ │ │ └── asynckit#0.4.0
│ │ ├─┬ har-validator#4.2.1
│ │ │ ├─┬ ajv#4.11.8
│ │ │ │ ├── co#4.6.0
│ │ │ │ └─┬ json-stable-stringify#1.0.1
│ │ │ │ └── jsonify#0.0.0
│ │ │ └── har-schema#1.0.5
│ │ ├─┬ 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.4.0
│ │ │ │ ├── assert-plus#1.0.0
│ │ │ │ ├── extsprintf#1.0.2
│ │ │ │ ├── json-schema#0.2.3
│ │ │ │ └── verror#1.3.6
│ │ │ └─┬ sshpk#1.13.1
│ │ │ ├── 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.7
│ │ │ │ └── assert-plus#1.0.0
│ │ │ ├── jsbn#0.1.1
│ │ │ └── tweetnacl#0.14.5
│ │ ├── is-typedarray#1.0.0
│ │ ├── isstream#0.1.2
│ │ ├── json-stringify-safe#5.0.1
│ │ ├─┬ mime-types#2.1.16
│ │ │ └── mime-db#1.29.0
│ │ ├── oauth-sign#0.8.2
│ │ ├── performance-now#0.2.0
│ │ ├── qs#6.4.0
│ │ ├── safe-buffer#5.1.1
│ │ ├── stringstream#0.0.5
│ │ └── tunnel-agent#0.6.0
│ ├─┬ tough-cookie#2.3.2
│ │ └── punycode#1.4.1
│ └── uuid#3.1.0
├── jhipster-core#1.3.5
├─┬ js-yaml#3.9.0
│ ├─┬ argparse#1.0.9
│ │ └── sprintf-js#1.0.3
│ └── esprima#4.0.0
├── lodash#4.17.4
├─┬ meow#3.7.0
│ ├─┬ camelcase-keys#2.1.0
│ │ └── camelcase#2.1.1
│ ├── decamelize#1.2.0
│ ├─┬ loud-rejection#1.6.0
│ │ ├─┬ currently-unhandled#0.4.1
│ │ │ └── array-find-index#1.0.2
│ │ └── signal-exit#3.0.2
│ ├── map-obj#1.0.1
│ ├── minimist#1.2.0
│ ├─┬ normalize-package-data#2.4.0
│ │ ├── hosted-git-info#2.5.0
│ │ ├─┬ is-builtin-module#1.0.0
│ │ │ └── builtin-modules#1.1.1
│ │ └─┬ validate-npm-package-license#3.0.1
│ │ ├─┬ spdx-correct#1.0.2
│ │ │ └── spdx-license-ids#1.2.2
│ │ └── spdx-expression-parse#1.0.4
│ ├─┬ read-pkg-up#1.0.1
│ │ ├─┬ find-up#1.1.2
│ │ │ └── path-exists#2.1.0
│ │ └─┬ read-pkg#1.1.0
│ │ ├─┬ load-json-file#1.1.0
│ │ │ └─┬ parse-json#2.2.0
│ │ │ └─┬ error-ex#1.3.1
│ │ │ └── is-arrayish#0.2.1
│ │ └── path-type#1.1.0
│ ├─┬ redent#1.0.0
│ │ ├─┬ indent-string#2.1.0
│ │ │ └─┬ repeating#2.0.1
│ │ │ └── is-finite#1.0.2
│ │ └── strip-indent#1.0.1
│ └── trim-newlines#1.0.0
├─┬ mkdirp#0.5.1
│ └── minimist#0.0.8
├── pluralize#5.0.0
├─┬ randexp#0.4.5
│ ├── discontinuous-range#1.0.0
│ └── ret#0.1.14
├── semver#5.3.0
├─┬ shelljs#0.7.8
│ ├── interpret#1.0.3
│ └─┬ rechoir#0.6.2
│ └─┬ resolve#1.4.0
│ └── path-parse#1.0.5
├─┬ tabtab#2.2.2
│ ├─┬ debug#2.6.8
│ │ └── ms#2.0.0
│ ├─┬ inquirer#1.2.3
│ │ ├─┬ chalk#1.1.3
│ │ │ ├── ansi-styles#2.2.1
│ │ │ └── supports-color#2.0.0
│ │ ├── cli-width#2.1.0
│ │ ├─┬ external-editor#1.1.1
│ │ │ ├─┬ spawn-sync#1.0.15
│ │ │ │ ├─┬ concat-stream#1.6.0
│ │ │ │ │ └── typedarray#0.0.6
│ │ │ │ └── os-shim#0.1.3
│ │ │ └── tmp#0.0.29
│ │ ├── mute-stream#0.0.6
│ │ ├─┬ pinkie-promise#2.0.1
│ │ │ └── pinkie#2.0.4
│ │ ├── run-async#2.3.0
│ │ ├── rx#4.1.0
│ │ └── string-width#1.0.2
│ ├── lodash.difference#4.5.0
│ ├── lodash.uniq#4.5.0
│ └─┬ npmlog#2.0.4
│ ├── ansi#0.3.1
│ ├─┬ are-we-there-yet#1.1.4
│ │ └── delegates#1.0.0
│ └─┬ gauge#1.2.7
│ ├── has-unicode#2.0.1
│ ├── lodash.pad#4.5.1
│ ├── lodash.padend#4.6.1
│ └── lodash.padstart#4.6.1
├─┬ yeoman-environment#2.0.0
│ ├─┬ chalk#1.1.3
│ │ ├── ansi-styles#2.2.1
│ │ └── supports-color#2.0.0
│ ├── diff#3.3.0
│ ├─┬ globby#6.1.0
│ │ ├─┬ array-union#1.0.2
│ │ │ └── array-uniq#1.0.3
│ │ └── pify#2.3.0
│ ├── grouped-queue#0.3.3
│ ├─┬ inquirer#3.2.1
│ │ ├── ansi-escapes#2.0.0
│ │ ├─┬ chalk#2.0.1
│ │ │ ├── ansi-styles#3.2.0
│ │ │ └── supports-color#4.2.1
│ │ ├─┬ cli-cursor#2.1.0
│ │ │ └─┬ restore-cursor#2.0.0
│ │ │ └─┬ onetime#2.0.1
│ │ │ └── mimic-fn#1.1.0
│ │ ├── cli-width#2.1.0
│ │ ├─┬ external-editor#2.0.4
│ │ │ ├── iconv-lite#0.4.18
│ │ │ ├── jschardet#1.5.0
│ │ │ └── tmp#0.0.31
│ │ ├── figures#2.0.0
│ │ ├── mute-stream#0.0.7
│ │ ├── run-async#2.3.0
│ │ ├── rx-lite#4.0.8
│ │ ├── rx-lite-aggregates#4.0.8
│ │ ├─┬ string-width#2.1.1
│ │ │ ├── is-fullwidth-code-point#2.0.0
│ │ │ └── strip-ansi#4.0.0
│ │ └─┬ strip-ansi#4.0.0
│ │ └── ansi-regex#3.0.0
│ ├─┬ is-scoped#1.0.0
│ │ └── scoped-regex#1.0.0
│ ├─┬ log-symbols#1.0.2
│ │ └─┬ chalk#1.1.3
│ │ ├── ansi-styles#2.2.1
│ │ └── supports-color#2.0.0
│ ├─┬ mem-fs#1.1.3
│ │ ├─┬ vinyl#1.2.0
│ │ │ ├── clone#1.0.2
│ │ │ ├── clone-stats#0.0.1
│ │ │ └── replace-ext#0.0.1
│ │ └─┬ vinyl-file#2.0.0
│ │ ├─┬ strip-bom#2.0.0
│ │ │ └── is-utf8#0.2.1
│ │ └─┬ strip-bom-stream#2.0.0
│ │ └── first-chunk-stream#2.0.0
│ ├── text-table#0.2.0
│ └── untildify#3.0.2
└─┬ yeoman-generator#1.1.1
├── async#2.5.0
├─┬ chalk#1.1.3
│ ├── ansi-styles#2.2.1
│ └── supports-color#2.0.0
├─┬ class-extend#0.1.2
│ └── object-assign#2.1.1
├─┬ cli-table#0.3.1
│ └── colors#1.0.3
├─┬ cross-spawn#5.1.0
│ ├─┬ lru-cache#4.1.1
│ │ ├── pseudomap#1.0.2
│ │ └── yallist#2.1.2
│ ├─┬ shebang-command#1.2.0
│ │ └── shebang-regex#1.0.0
│ └─┬ which#1.2.14
│ └── isexe#2.0.0
├── dargs#5.1.0
├── dateformat#2.0.0
├── detect-conflict#1.0.1
├─┬ error#7.0.2
│ ├── string-template#0.2.1
│ └── xtend#4.0.1
├─┬ find-up#2.1.0
│ └─┬ locate-path#2.0.0
│ ├─┬ p-locate#2.0.0
│ │ └── p-limit#1.1.0
│ └── path-exists#3.0.0
├─┬ github-username#3.0.0
│ └─┬ gh-got#5.0.0
│ ├─┬ got#6.7.1
│ │ ├─┬ create-error-class#3.0.2
│ │ │ └── capture-stack-trace#1.0.0
│ │ ├── duplexer3#0.1.4
│ │ ├── get-stream#3.0.0
│ │ ├── is-redirect#1.0.0
│ │ ├── is-retry-allowed#1.1.0
│ │ ├── is-stream#1.1.0
│ │ ├── lowercase-keys#1.0.0
│ │ ├── timed-out#4.0.1
│ │ ├── unzip-response#2.0.1
│ │ └─┬ url-parse-lax#1.0.0
│ │ └── prepend-http#1.0.4
│ └── is-plain-obj#1.1.0
├─┬ istextorbinary#2.1.0
│ ├── binaryextensions#2.0.0
│ ├── editions#1.3.3
│ └── textextensions#2.1.0
├─┬ mem-fs-editor#3.0.2
│ ├── commondir#1.0.1
│ ├── deep-extend#0.4.2
│ ├─┬ multimatch#2.1.0
│ │ ├── array-differ#1.0.0
│ │ └── arrify#1.0.1
│ └─┬ vinyl#2.1.0
│ ├── clone#2.1.1
│ ├── clone-buffer#1.0.0
│ ├── clone-stats#1.0.0
│ ├── cloneable-readable#1.0.0
│ ├── remove-trailing-separator#1.0.2
│ └── replace-ext#1.0.0
├── path-exists#3.0.0
├── pretty-bytes#4.0.2
├── read-chunk#2.0.0
├─┬ read-pkg-up#2.0.0
│ └─┬ read-pkg#2.0.0
│ ├─┬ load-json-file#2.0.0
│ │ └── strip-bom#3.0.0
│ └── path-type#2.0.0
├── rimraf#2.6.1
├─┬ run-async#2.3.0
│ └── is-promise#2.1.0
├── through2#2.0.3
├─┬ user-home#2.0.0
│ └── os-homedir#1.0.2
└─┬ yeoman-environment#1.6.6
├── diff#2.2.3
├─┬ globby#4.1.0
│ └── glob#6.0.4
├─┬ inquirer#1.2.3
│ ├── cli-width#2.1.0
│ └── mute-stream#0.0.6
└── untildify#2.1.0*
--
hubtalents-jhipster myuser$ yo jhipster
Error jhipster
You don't seem to have a generator with the name jhipster installed.
You can see available generators with npm search yeoman-generator and then install them with npm install [name].
To see the 1 registered generators run yo with the `--help` option.
I don't understand what's happen. The generator is installed without error but it's not found by yo. Is there a mistake in my configuration or install ?
Thanks
With the new version of JHipster, run only the command 'jhipster'
jhipster
And not 'yo jhipster'
I think you should probably type this in your command line interface:
update NPM: npm install -g npm
To install JHipster, type:
npm install -g generator-jhipster
Have you tried yarn? Let's say you are on Ubuntu, you can install yarn here and run these:
yarn global add yo
yarn global add generator-jhipster
Surely you can skip installing yo if it's already exists in PATH.
Check that npm, node and yarn are up to date, I had the same problem and I solved it by purging and reinstalling both.
if you are on ubuntu this might help.
Use jhipster upgrade assuming that your project meet the upgrade requirements - has a git repo containing a .yo-rc.json file and a .jhipster directory.

Passenger + Nginx + Node (Meteor) 100% CPU usage

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

Node how to make dependency analysis and remove unused module dependecies

My node modules is a simple module that have few dependencies and makes use mostly of built-in modules.
Given that, my module has a dependency of a module that declares those dependencies
"dependencies": {
"events": "^1.1.1",
"geocoder": "^0.2.2",
"gpsoauthnode": "^0.0.5",
"istanbul": "^0.4.4",
"protobufjs": "^5.0.1",
"request": "^2.73.0",
"s2geometry-node": "^1.3.0",
"tape": "^4.6.0"
}
Running npm install will end up in the following node_submodules tree
├─┬ body-parser#1.15.2
│ ├── bytes#2.4.0
│ ├── content-type#1.0.2
│ ├─┬ debug#2.2.0
│ │ └── ms#0.7.1
│ ├── depd#1.1.0
│ ├─┬ http-errors#1.5.0
│ │ ├── inherits#2.0.1
│ │ ├── setprototypeof#1.0.1
│ │ └── statuses#1.3.0
│ ├── iconv-lite#0.4.13
│ ├─┬ on-finished#2.3.0
│ │ └── ee-first#1.1.1
│ ├── qs#6.2.0
│ ├─┬ raw-body#2.1.7
│ │ └── unpipe#1.0.0
│ └─┬ type-is#1.6.13
│ └── media-typer#0.3.0
├─┬ express#4.14.0
│ ├─┬ accepts#1.3.3
│ │ └── negotiator#0.6.1
│ ├── array-flatten#1.1.1
│ ├── content-disposition#0.5.1
│ ├── cookie#0.3.1
│ ├── cookie-signature#1.0.6
│ ├── encodeurl#1.0.1
│ ├── escape-html#1.0.3
│ ├── etag#1.7.0
│ ├── finalhandler#0.5.0
│ ├── fresh#0.3.0
│ ├── merge-descriptors#1.0.1
│ ├── methods#1.1.2
│ ├── parseurl#1.3.1
│ ├── path-to-regexp#0.1.7
│ ├─┬ proxy-addr#1.1.2
│ │ ├── forwarded#0.1.0
│ │ └── ipaddr.js#1.1.1
│ ├── range-parser#1.2.0
│ ├─┬ send#0.14.1
│ │ ├── destroy#1.0.4
│ │ └── mime#1.3.4
│ ├── serve-static#1.11.1
│ ├── utils-merge#1.0.0
│ └── vary#1.1.0
├─┬ pokemon-go-node-api#1.3.1
│ ├── events#1.1.1
│ ├─┬ geocoder#0.2.2
│ │ ├─┬ request#2.11.1
│ │ │ ├─┬ form-data#0.0.3
│ │ │ │ ├── async#0.1.9
│ │ │ │ └─┬ combined-stream#0.0.3
│ │ │ │ └── delayed-stream#0.0.5
│ │ │ └── mime#1.2.7
│ │ ├── underscore#1.3.3
│ │ └─┬ xml2js#0.2.0
│ │ └── sax#1.2.1
│ ├─┬ gpsoauthnode#0.0.5
│ │ └── crypto-js#3.1.6
│ ├─┬ istanbul#0.4.4
│ │ ├── abbrev#1.0.9
│ │ ├── async#1.5.2
│ │ ├─┬ escodegen#1.8.0
│ │ │ ├── estraverse#1.9.3
│ │ │ ├── esutils#2.0.2
│ │ │ ├─┬ optionator#0.8.1
│ │ │ │ ├── deep-is#0.1.3
│ │ │ │ ├── fast-levenshtein#1.1.4
│ │ │ │ ├── levn#0.3.0
│ │ │ │ ├── prelude-ls#1.1.2
│ │ │ │ └── type-check#0.3.2
│ │ │ └─┬ source-map#0.2.0
│ │ │ └── amdefine#1.0.0
│ │ ├── esprima#2.7.2
│ │ ├─┬ fileset#0.2.1
│ │ │ └─┬ minimatch#2.0.10
│ │ │ └─┬ brace-expansion#1.1.6
│ │ │ ├── balanced-match#0.4.2
│ │ │ └── concat-map#0.0.1
│ │ ├─┬ handlebars#4.0.5
│ │ │ ├─┬ optimist#0.6.1
│ │ │ │ ├── minimist#0.0.10
│ │ │ │ └── wordwrap#0.0.3
│ │ │ ├── source-map#0.4.4
│ │ │ └─┬ uglify-js#2.7.0
│ │ │ ├── async#0.2.10
│ │ │ ├── source-map#0.5.6
│ │ │ └── uglify-to-browserify#1.0.2
│ │ ├─┬ js-yaml#3.6.1
│ │ │ └─┬ argparse#1.0.7
│ │ │ └── sprintf-js#1.0.3
│ │ ├─┬ mkdirp#0.5.1
│ │ │ └── minimist#0.0.8
│ │ ├── nopt#3.0.6
│ │ ├─┬ once#1.3.3
│ │ │ └── wrappy#1.0.2
│ │ ├── resolve#1.1.7
│ │ ├─┬ supports-color#3.1.2
│ │ │ └── has-flag#1.0.0
│ │ ├─┬ which#1.2.10
│ │ │ └── isexe#1.1.2
│ │ └── wordwrap#1.0.0
│ ├─┬ protobufjs#5.0.1
│ │ ├─┬ ascli#1.0.0
│ │ │ ├── colour#0.7.1
│ │ │ └── optjs#3.2.2
│ │ ├─┬ bytebuffer#5.0.1
│ │ │ └── long#3.2.0
│ │ ├─┬ glob#5.0.15
│ │ │ ├── inflight#1.0.5
│ │ │ └── path-is-absolute#1.0.0
│ │ └─┬ 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.0.3
│ │ │ │ │ │ └── is-buffer#1.1.3
│ │ │ │ │ ├── longest#1.0.1
│ │ │ │ │ └── repeat-string#1.5.4
│ │ │ │ └── lazy-cache#1.0.4
│ │ │ ├── right-align#0.1.3
│ │ │ └── wordwrap#0.0.2
│ │ ├── decamelize#1.2.0
│ │ └── window-size#0.1.0
│ ├─┬ s2geometry-node#1.3.1
│ │ └── bindings#1.2.1
│ └─┬ tape#4.6.0
│ ├── deep-equal#1.0.1
│ ├── defined#1.0.0
│ ├── function-bind#1.1.0
│ ├─┬ glob#7.0.5
│ │ ├── fs.realpath#1.0.0
│ │ └── minimatch#3.0.2
│ ├── has#1.0.1
│ ├── minimist#1.2.0
│ ├── object-inspect#1.2.1
│ ├── resumer#0.0.0
│ ├─┬ string.prototype.trim#1.1.2
│ │ ├─┬ define-properties#1.1.2
│ │ │ ├── foreach#2.0.5
│ │ │ └── object-keys#1.0.11
│ │ └─┬ es-abstract#1.5.1
│ │ ├─┬ es-to-primitive#1.1.1
│ │ │ ├── is-date-object#1.0.1
│ │ │ └── is-symbol#1.0.1
│ │ ├── is-callable#1.1.3
│ │ └── is-regex#1.0.3
│ └── through#2.3.8
├─┬ request#2.74.0
│ ├── aws-sign2#0.6.0
│ ├── aws4#1.4.1
│ ├─┬ bl#1.1.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
│ ├── 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#1.0.0-rc4
│ ├─┬ 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
│ │ │ │ └── ansi-regex#2.0.0
│ │ │ ├── strip-ansi#3.0.1
│ │ │ └── supports-color#2.0.0
│ │ ├─┬ commander#2.9.0
│ │ │ └── graceful-readlink#1.0.1
│ │ ├─┬ is-my-json-valid#2.13.1
│ │ │ ├── generate-function#2.0.0
│ │ │ ├─┬ generate-object-property#1.2.0
│ │ │ │ └── is-property#1.0.2
│ │ │ ├── jsonpointer#2.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.0
│ │ │ ├── extsprintf#1.0.2
│ │ │ ├── json-schema#0.2.2
│ │ │ └── verror#1.3.6
│ │ └─┬ sshpk#1.8.3
│ │ ├── asn1#0.2.3
│ │ ├── assert-plus#1.0.0
│ │ ├─┬ dashdash#1.14.0
│ │ │ └── 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.13.3
│ ├── is-typedarray#1.0.0
│ ├── isstream#0.1.2
│ ├── json-stringify-safe#5.0.1
│ ├─┬ mime-types#2.1.11
│ │ └── mime-db#1.23.0
│ ├── node-uuid#1.4.7
│ ├── oauth-sign#0.8.2
│ ├── stringstream#0.0.5
│ ├── tough-cookie#2.3.0
│ └── tunnel-agent#0.4.3
└─┬ tough-cookie-filestore#0.0.1
└─┬ tough-cookie#0.12.1
└── punycode#2.0.0
that is nothing less than
node_modules admin$ du -d0 -h
40M .
40Meg, what? At first look I was a bit surprised of that, since the list of dependencies seems to be too much. I would expect something like that from the Makefile of low level C library like Boost, libcrypto, libxml, libssl or whatever C/C++ library used by an OS, but, hey wait a moment, this is just a simple application using built-in library and just one external dependency. So, what's going on here?
Being serious, my question is: is there a way to make a static analysis of node packages installed via npm? And then to prune unused dependencies?
For sure, my module will not use at runtime most of the function declarations in the private scope of each of those modules, defined in this tree.

TopoJson Install Error?

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)

Resources