Trait not implemented for a thing I think implements the trait - rust

I am trying to call a method from a rust crate and getting an error stating that a trait is not implemented for one of the methods I am passing however when I look the method up on docs.rs it does appear to be implementing the required trait.
I am trying to call a method called new_with_count from a crate called wagyu_ethereum.
The code I am using to make the call is here:
use rand::{rngs::StdRng, SeedableRng};
use wagyu_ethereum::*;
use wagyu_model::mnemonic::MnemonicCount;
use wagyu_model::MnemonicError;
pub fn generate_mnemonic() -> Result<String, MnemonicError> {
let mut rng = StdRng::from_entropy();
let mnemonic = EthereumMnemonic::<
wagyu_ethereum::network::Mainnet,
wagyu_ethereum::wordlist::English,
>::new_with_count(&mut rng, 24)?;
Ok(String::from("placeholder"))
}
The code for the method (from the projects GitHub page:
impl<N: EthereumNetwork, W: EthereumWordlist> MnemonicCount for EthereumMnemonic<N, W> {
/// Returns a new mnemonic given the word count.
fn new_with_count<R: Rng>(rng: &mut R, word_count: u8) -> Result<Self, MnemonicError> {
let length: usize = match word_count {
12 => 16,
15 => 20,
18 => 24,
21 => 28,
24 => 32,
wc => return Err(MnemonicError::InvalidWordCount(wc)),
};
let entropy: [u8; 32] = rng.gen();
Ok(Self {
entropy: entropy[0..length].to_vec(),
_network: PhantomData,
_wordlist: PhantomData,
})
}
}
The error:
error[E0277]: the trait bound `StdRng: rand_core::RngCore` is not satisfied
--> src/lib.rs:12:23
|
9 | let mnemonic = EthereumMnemonic::<
| ____________________-
10 | | wagyu_ethereum::network::Mainnet,
11 | | wagyu_ethereum::wordlist::English,
12 | | >::new_with_count(&mut rng, 24)?;
| | - ^^^^^^^^ the trait `rand_core::RngCore` is not implemented for `StdRng`
| |_____________________|
| required by a bound introduced by this call
|
= help: the following other types implement trait `rand_core::RngCore`:
&'a mut R
Box<R>
rand::rngs::adapter::read::ReadRng<R>
rand::rngs::adapter::reseeding::ReseedingRng<R, Rsdr>
rand::rngs::entropy::EntropyRng
rand::rngs::mock::StepRng
rand::rngs::std::StdRng
rand::rngs::thread::ThreadRng
and 6 others
= note: required because of the requirements on the impl of `rand::Rng` for `StdRng`
note: required by a bound in `new_with_count`
--> /home/me/.cargo/registry/src/github.com-1ecc6299db9ec823/wagyu-model-0.6.3/src/mnemonic.rs:44:26
|
44 | fn new_with_count<R: Rng>(rng: &mut R, word_count: u8) -> Result<Self, MnemonicError>;
| ^^^ required by this bound in `new_with_count`
So as far as I can tell from the documentation on docs.rs it appears that StdRng does actually implement RngCore. I've also found this question that indicates I might be borrowing to many time but I'm not sure if it is relevant here because I don't think I am borrowing as many times.
Finally on the projects Github account they have instances of calling the method the same way I am doing (method call, rng assignment). This is what prompted me to use this method. Their program also works when you run it. So the question I have is what am I doing wrong when trying to call this method?

At the time of writing, the newest versions are:
rand = "0.8.5"
wagyu-ethereum = "0.6.3"
wagyu-model = "0.6.3"
It seems that a version mismatch exists here. wagyu-ethereum = "0.6.3" depends on rand = "0.7.3", while the current default if you do cargo add rand is rand = "0.8.5".
You can see this in cargo tree:
rust_test v0.1.0 (/home/me/work/rust_test)
├── rand v0.8.5
│ ├── libc v0.2.139
│ ├── rand_chacha v0.3.1
│ │ ├── ppv-lite86 v0.2.17
│ │ └── rand_core v0.6.4
│ │ └── getrandom v0.2.8
│ │ ├── cfg-if v1.0.0
│ │ └── libc v0.2.139
│ └── rand_core v0.6.4 (*)
├── wagyu-ethereum v0.6.3
│ ├── base58 v0.1.0
│ ├── bitvec v0.17.4
│ │ ├── either v1.8.0
│ │ └── radium v0.3.0
│ ├── ethereum-types v0.9.2
│ │ ├── ethbloom v0.9.2
│ │ │ ├── crunchy v0.2.2
│ │ │ ├── fixed-hash v0.6.1
│ │ │ │ ├── byteorder v1.4.3
│ │ │ │ ├── rand v0.7.3
│ │ │ │ │ ├── getrandom v0.1.16
│ │ │ │ │ │ ├── cfg-if v1.0.0
│ │ │ │ │ │ └── libc v0.2.139
│ │ │ │ │ ├── libc v0.2.139
│ │ │ │ │ ├── rand_chacha v0.2.2
│ │ │ │ │ │ ├── ppv-lite86 v0.2.17
│ │ │ │ │ │ └── rand_core v0.5.1
│ │ │ │ │ │ └── getrandom v0.1.16 (*)
│ │ │ │ │ └── rand_core v0.5.1 (*)
│ │ │ │ ├── rustc-hex v2.1.0
│ │ │ │ └── static_assertions v1.1.0
│ │ │ ├── impl-rlp v0.2.1
│ │ │ │ └── rlp v0.4.6
│ │ │ │ └── rustc-hex v2.1.0
│ │ │ ├── impl-serde v0.3.2
│ │ │ │ └── serde v1.0.152
│ │ │ │ └── serde_derive v1.0.152 (proc-macro)
│ │ │ │ ├── proc-macro2 v1.0.49
│ │ │ │ │ └── unicode-ident v1.0.6
│ │ │ │ ├── quote v1.0.23
│ │ │ │ │ └── proc-macro2 v1.0.49 (*)
│ │ │ │ └── syn v1.0.107
│ │ │ │ ├── proc-macro2 v1.0.49 (*)
│ │ │ │ ├── quote v1.0.23 (*)
│ │ │ │ └── unicode-ident v1.0.6
│ │ │ └── tiny-keccak v2.0.2
│ │ │ └── crunchy v0.2.2
│ │ ├── fixed-hash v0.6.1 (*)
│ │ ├── impl-rlp v0.2.1 (*)
│ │ ├── impl-serde v0.3.2 (*)
│ │ ├── primitive-types v0.7.3
│ │ │ ├── fixed-hash v0.6.1 (*)
│ │ │ ├── impl-codec v0.4.2
│ │ │ │ └── parity-scale-codec v1.3.7
│ │ │ │ ├── arrayvec v0.5.2
│ │ │ │ ├── bitvec v0.17.4 (*)
│ │ │ │ ├── byte-slice-cast v0.3.5
│ │ │ │ └── serde v1.0.152 (*)
│ │ │ ├── impl-rlp v0.2.1 (*)
│ │ │ ├── impl-serde v0.3.2 (*)
│ │ │ └── uint v0.8.5
│ │ │ ├── byteorder v1.4.3
│ │ │ ├── crunchy v0.2.2
│ │ │ ├── rustc-hex v2.1.0
│ │ │ └── static_assertions v1.1.0
│ │ └── uint v0.8.5 (*)
│ ├── hex v0.4.3
│ ├── hmac v0.7.1
│ │ ├── crypto-mac v0.7.0
│ │ │ ├── generic-array v0.12.4
│ │ │ │ └── typenum v1.16.0
│ │ │ └── subtle v1.0.0
│ │ └── digest v0.8.1
│ │ └── generic-array v0.12.4 (*)
│ ├── pbkdf2 v0.3.0
│ │ ├── byteorder v1.4.3
│ │ ├── crypto-mac v0.7.0 (*)
│ │ └── rayon v1.6.1
│ │ ├── either v1.8.0
│ │ └── rayon-core v1.10.1
│ │ ├── crossbeam-channel v0.5.6
│ │ │ ├── cfg-if v1.0.0
│ │ │ └── crossbeam-utils v0.8.14
│ │ │ └── cfg-if v1.0.0
│ │ ├── crossbeam-deque v0.8.2
│ │ │ ├── cfg-if v1.0.0
│ │ │ ├── crossbeam-epoch v0.9.13
│ │ │ │ ├── cfg-if v1.0.0
│ │ │ │ ├── crossbeam-utils v0.8.14 (*)
│ │ │ │ ├── memoffset v0.7.1
│ │ │ │ │ [build-dependencies]
│ │ │ │ │ └── autocfg v1.1.0
│ │ │ │ └── scopeguard v1.1.0
│ │ │ │ [build-dependencies]
│ │ │ │ └── autocfg v1.1.0
│ │ │ └── crossbeam-utils v0.8.14 (*)
│ │ ├── crossbeam-utils v0.8.14 (*)
│ │ └── num_cpus v1.15.0
│ │ └── libc v0.2.139
│ ├── rand v0.7.3 (*)
│ ├── regex v1.7.0
│ │ ├── aho-corasick v0.7.20
│ │ │ └── memchr v2.5.0
│ │ ├── memchr v2.5.0
│ │ └── regex-syntax v0.6.28
│ ├── rlp v0.4.6 (*)
│ ├── secp256k1 v0.17.2
│ │ └── secp256k1-sys v0.1.2
│ │ [build-dependencies]
│ │ └── cc v1.0.41
│ ├── serde v1.0.152 (*)
│ ├── serde_json v1.0.91
│ │ ├── itoa v1.0.5
│ │ ├── ryu v1.0.12
│ │ └── serde v1.0.152 (*)
│ ├── sha2 v0.8.2
│ │ ├── block-buffer v0.7.3
│ │ │ ├── block-padding v0.1.5
│ │ │ │ └── byte-tools v0.3.1
│ │ │ ├── byte-tools v0.3.1
│ │ │ ├── byteorder v1.4.3
│ │ │ └── generic-array v0.12.4 (*)
│ │ ├── digest v0.8.1 (*)
│ │ ├── fake-simd v0.1.2
│ │ └── opaque-debug v0.2.3
│ ├── tiny-keccak v1.5.0
│ │ └── crunchy v0.2.2
│ └── wagyu-model v0.6.3
│ ├── base58 v0.1.0
│ ├── base58-monero v0.2.1
│ │ ├── async-stream v0.2.1
│ │ │ ├── async-stream-impl v0.2.1 (proc-macro)
│ │ │ │ ├── proc-macro2 v1.0.49 (*)
│ │ │ │ ├── quote v1.0.23 (*)
│ │ │ │ └── syn v1.0.107 (*)
│ │ │ └── futures-core v0.3.25
│ │ ├── futures-util v0.3.25
│ │ │ ├── futures-core v0.3.25
│ │ │ ├── futures-macro v0.3.25 (proc-macro)
│ │ │ │ ├── proc-macro2 v1.0.49 (*)
│ │ │ │ ├── quote v1.0.23 (*)
│ │ │ │ └── syn v1.0.107 (*)
│ │ │ ├── futures-task v0.3.25
│ │ │ ├── pin-project-lite v0.2.9
│ │ │ ├── pin-utils v0.1.0
│ │ │ └── slab v0.4.7
│ │ │ [build-dependencies]
│ │ │ └── autocfg v1.1.0
│ │ ├── thiserror v1.0.38
│ │ │ └── thiserror-impl v1.0.38 (proc-macro)
│ │ │ ├── proc-macro2 v1.0.49 (*)
│ │ │ ├── quote v1.0.23 (*)
│ │ │ └── syn v1.0.107 (*)
│ │ ├── tiny-keccak v2.0.2 (*)
│ │ └── tokio v0.2.25
│ │ ├── bytes v0.5.6
│ │ ├── futures-core v0.3.25
│ │ ├── memchr v2.5.0
│ │ └── pin-project-lite v0.1.12
│ ├── bech32 v0.6.0
│ ├── byteorder v1.4.3
│ ├── crypto-mac v0.7.0 (*)
│ ├── ethereum-types v0.9.2 (*)
│ ├── failure v0.1.8
│ │ ├── backtrace v0.3.57
│ │ │ ├── addr2line v0.14.1
│ │ │ │ └── gimli v0.23.0
│ │ │ ├── cfg-if v1.0.0
│ │ │ ├── libc v0.2.139
│ │ │ ├── miniz_oxide v0.4.4
│ │ │ │ └── adler v1.0.2
│ │ │ │ [build-dependencies]
│ │ │ │ └── autocfg v1.1.0
│ │ │ ├── object v0.23.0
│ │ │ └── rustc-demangle v0.1.21
│ │ └── failure_derive v0.1.8 (proc-macro)
│ │ ├── proc-macro2 v1.0.49 (*)
│ │ ├── quote v1.0.23 (*)
│ │ ├── syn v1.0.107 (*)
│ │ └── synstructure v0.12.6
│ │ ├── proc-macro2 v1.0.49 (*)
│ │ ├── quote v1.0.23 (*)
│ │ ├── syn v1.0.107 (*)
│ │ └── unicode-xid v0.2.4
│ ├── ff v0.6.0
│ │ ├── byteorder v1.4.3
│ │ └── rand_core v0.5.1 (*)
│ ├── hex v0.4.3
│ ├── rand v0.7.3 (*)
│ ├── rand_core v0.5.1 (*)
│ ├── ripemd160 v0.8.0
│ │ ├── block-buffer v0.7.3 (*)
│ │ ├── digest v0.8.1 (*)
│ │ └── opaque-debug v0.2.3
│ ├── rlp v0.4.6 (*)
│ ├── secp256k1 v0.17.2 (*)
│ ├── serde_json v1.0.91 (*)
│ ├── sha2 v0.8.2 (*)
│ └── uint v0.8.5 (*)
└── wagyu-model v0.6.3 (*)
Usually, Cargo tries to find a single common version of a library for all dependencies, but 0.7.x and 0.8.x are not compatible according to Rust's semver rules, so it includes the library twice. Of course it can't allow those two to be used with each other, as the results would be unpredictable.
While the problem is complicated and obscure, the solution is simple:
Use rand = "0.7.3" in your Cargo.toml until wagyu gets upgraded to rand = "0.8.x".
You could open an issue in their issue-tracker about it, but it seems that the project as a whole didn't get maintained since over a year. Their website doesn't even exist any more. So be aware that this project might be abandoned.

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.

Karma PhantomJs - TypeError on Linux and on Win 7 all tests succeed

I am running the commands
npm install karma karma-jasmine karma-phantomjs-launcher phantomjs#2.1.7 jasmine-core --save-dev
karma start
on my Linux CentOs 7.2 machine and get this error:
bower_components/angular/angular.js:4641:53
forEach#bower_components/angular/angular.js:321:24
loadModules#bower_components/angular/angular.js:4601:12
createInjector#bower_components/angular/angular.js:4523:30
workFn#vendor/angular-mocks.js:2427:60
TypeError: undefined is not an object (evaluating '$rootScope.$new') in my-components/my-specific-component/spec/mySpecificController.spec.js (line 84)
createController#my-components/my-specific-component/spec/mySpecificController.spec.js:84:37
my-components/my-specific-component/spec/mySpecificController.spec.js:92:42
(...10 more tests failing in the same spec...)
PhantomJS 2.1.1 (Linux 0.0.0): Executed 54 of 54 (11 FAILED) (0.349 secs / 1.251 secs)
I run the exact same command on my Windows 7 machine and all tests complete successfully:
PhantomJS 2.1.1 (Windows 7 0.0.0): Executed 54 of 54 SUCCESS (0.152 secs / 1.102 secs)
I checked the versions of the installed npm:
Win 7 ---> npm 2.15.1
CentOs 7.2 ---> npm 3.10.3
Comment: Shouldn't be a showstopper, shouldn't it?
Installed modules in npm on Win 7:
myuser#mycomputer MINGW64 /c/Users/myuser/IdeaProjects/my_project/src/main/webapp (feature/some-feature)
$ npm ls --global
C:\Users\myuser\AppData\Roaming\npm
├── bower#1.7.9
└─┬ karma-cli#1.0.1
└── resolve#1.1.7
Installed npm modules in CentOs7:
[root#localhost webapp]# npm ls --global
/usr/lib
├── ansi#0.2.1
├── bower#1.7.9
├─┬ karma-cli#1.0.1
│ └── resolve#1.1.7
├─┬ npm#3.10.3
│ ├── abbrev#1.0.9 -> /usr/lib/node_modules/npm/node_modules.bundled/abbrev
│ ├── ansi-regex#2.0.0 -> /usr/lib/node_modules/npm/node_modules.bundled/ansi-regex
│ ├── ansicolors#0.3.2 -> /usr/lib/node_modules/npm/node_modules.bundled/ansicolors
│ ├── ansistyles#0.1.3 -> /usr/lib/node_modules/npm/node_modules.bundled/ansistyles
│ ├── aproba#1.0.4 -> /usr/lib/node_modules/npm/node_modules.bundled/aproba
│ ├── archy#1.0.0 -> /usr/lib/node_modules/npm/node_modules.bundled/archy
│ ├── asap#2.0.4 -> /usr/lib/node_modules/npm/node_modules.bundled/asap
│ ├── chownr#1.0.1 -> /usr/lib/node_modules/npm/node_modules.bundled/chownr
│ ├── cmd-shim#2.0.2 -> /usr/lib/node_modules/npm/node_modules.bundled/cmd-shim
│ ├─┬ columnify#1.5.4 -> /usr/lib/node_modules/npm/node_modules.bundled/columnify
│ │ └─┬ wcwidth#1.0.0
│ │ └─┬ defaults#1.0.3
│ │ └── clone#1.0.2
│ ├─┬ config-chain#1.1.10 -> /usr/lib/node_modules/npm/node_modules.bundled/config-chain
│ │ └── proto-list#1.2.4
│ ├── debuglog#1.0.1 -> /usr/lib/node_modules/npm/node_modules.bundled/debuglog
│ ├── dezalgo#1.0.3 -> /usr/lib/node_modules/npm/node_modules.bundled/dezalgo
│ ├── editor#1.0.0 -> /usr/lib/node_modules/npm/node_modules.bundled/editor
│ ├── fs-vacuum#1.2.9 -> /usr/lib/node_modules/npm/node_modules.bundled/fs-vacuum
│ ├── fs-write-stream-atomic#1.0.8 -> /usr/lib/node_modules/npm/node_modules.bundled/fs-write-stream-atomic
│ ├── fstream#1.0.10 -> /usr/lib/node_modules/npm/node_modules.bundled/fstream
│ ├─┬ fstream-npm#1.1.0 -> /usr/lib/node_modules/npm/node_modules.bundled/fstream-npm
│ │ └─┬ fstream-ignore#1.0.5
│ │ └─┬ minimatch#3.0.0
│ │ └─┬ brace-expansion#1.1.4
│ │ ├── balanced-match#0.4.1
│ │ └── concat-map#0.0.1
│ ├─┬ glob#7.0.4 -> /usr/lib/node_modules/npm/node_modules.bundled/glob
│ │ ├── fs.realpath#1.0.0
│ │ ├─┬ minimatch#3.0.0
│ │ │ └─┬ brace-expansion#1.1.5
│ │ │ ├── balanced-match#0.4.1
│ │ │ └── concat-map#0.0.1
│ │ └── path-is-absolute#1.0.0
│ ├── graceful-fs#4.1.4 -> /usr/lib/node_modules/npm/node_modules.bundled/graceful-fs
│ ├── has-unicode#2.0.1 -> /usr/lib/node_modules/npm/node_modules.bundled/has-unicode
│ ├── hosted-git-info#2.1.5 -> /usr/lib/node_modules/npm/node_modules.bundled/hosted-git-info
│ ├── iferr#0.1.5 -> /usr/lib/node_modules/npm/node_modules.bundled/iferr
│ ├── imurmurhash#0.1.4 -> /usr/lib/node_modules/npm/node_modules.bundled/imurmurhash
│ ├── inflight#1.0.5 -> /usr/lib/node_modules/npm/node_modules.bundled/inflight
│ ├── inherits#2.0.1 -> /usr/lib/node_modules/npm/node_modules.bundled/inherits
│ ├── ini#1.3.4 -> /usr/lib/node_modules/npm/node_modules.bundled/ini
│ ├─┬ init-package-json#1.9.4 -> /usr/lib/node_modules/npm/node_modules.bundled/init-package-json
│ │ ├─┬ glob#6.0.4
│ │ │ ├─┬ minimatch#3.0.0
│ │ │ │ └─┬ brace-expansion#1.1.4
│ │ │ │ ├── balanced-match#0.4.1
│ │ │ │ └── concat-map#0.0.1
│ │ │ └── path-is-absolute#1.0.0
│ │ └── promzard#0.3.0
│ ├── lockfile#1.0.1 -> /usr/lib/node_modules/npm/node_modules.bundled/lockfile
│ ├── lodash._baseindexof#3.1.0 -> /usr/lib/node_modules/npm/node_modules.bundled/lodash._baseindexof
│ ├─┬ lodash._baseuniq#4.6.0 -> /usr/lib/node_modules/npm/node_modules.bundled/lodash._baseuniq
│ │ ├── lodash._createset#4.0.3
│ │ └── lodash._root#3.0.1
│ ├── lodash._bindcallback#3.0.1 -> /usr/lib/node_modules/npm/node_modules.bundled/lodash._bindcallback
│ ├── lodash._cacheindexof#3.0.2 -> /usr/lib/node_modules/npm/node_modules.bundled/lodash._cacheindexof
│ ├── lodash._createcache#3.1.2 -> /usr/lib/node_modules/npm/node_modules.bundled/lodash._createcache
│ ├── lodash._getnative#3.9.1 -> /usr/lib/node_modules/npm/node_modules.bundled/lodash._getnative
│ ├─┬ lodash.clonedeep#4.3.2 -> /usr/lib/node_modules/npm/node_modules.bundled/lodash.clonedeep
│ │ └── lodash._baseclone#4.5.3
│ ├── lodash.restparam#3.6.1 -> /usr/lib/node_modules/npm/node_modules.bundled/lodash.restparam
│ ├─┬ lodash.union#4.4.0 -> /usr/lib/node_modules/npm/node_modules.bundled/lodash.union
│ │ ├── lodash._baseflatten#4.2.1
│ │ └── lodash.rest#4.0.3
│ ├── lodash.uniq#4.3.0 -> /usr/lib/node_modules/npm/node_modules.bundled/lodash.uniq
│ ├─┬ lodash.without#4.2.0 -> /usr/lib/node_modules/npm/node_modules.bundled/lodash.without
│ │ ├─┬ lodash._basedifference#4.5.0
│ │ │ └── lodash._root#3.0.1
│ │ └── lodash.rest#4.0.3
│ ├─┬ mkdirp#0.5.1 -> /usr/lib/node_modules/npm/node_modules.bundled/mkdirp
│ │ └── minimist#0.0.8
│ ├─┬ node-gyp#3.3.1 -> /usr/lib/node_modules/npm/node_modules.bundled/node-gyp
│ │ ├─┬ glob#4.5.3
│ │ │ └─┬ minimatch#2.0.10
│ │ │ └─┬ brace-expansion#1.1.3
│ │ │ ├── balanced-match#0.3.0
│ │ │ └── concat-map#0.0.1
│ │ ├─┬ minimatch#1.0.0
│ │ │ ├── lru-cache#2.7.3
│ │ │ └── sigmund#1.0.1
│ │ ├─┬ npmlog#2.0.4
│ │ │ ├── ansi#0.3.1
│ │ │ ├─┬ are-we-there-yet#1.1.2
│ │ │ │ └── delegates#1.0.0
│ │ │ └─┬ gauge#1.2.7
│ │ │ ├─┬ lodash.pad#4.4.0
│ │ │ │ ├── lodash._baseslice#4.0.0
│ │ │ │ ├── lodash._basetostring#4.12.0
│ │ │ │ └── lodash.tostring#4.1.3
│ │ │ ├─┬ lodash.padend#4.5.0
│ │ │ │ ├── lodash._baseslice#4.0.0
│ │ │ │ ├── lodash._basetostring#4.12.0
│ │ │ │ └── lodash.tostring#4.1.3
│ │ │ └─┬ lodash.padstart#4.5.0
│ │ │ ├── lodash._baseslice#4.0.0
│ │ │ ├── lodash._basetostring#4.12.0
│ │ │ └── lodash.tostring#4.1.3
│ │ └─┬ path-array#1.0.1
│ │ └─┬ array-index#1.0.0
│ │ ├─┬ debug#2.2.0
│ │ │ └── ms#0.7.1
│ │ └─┬ es6-symbol#3.0.2
│ │ ├── d#0.1.1
│ │ └─┬ es5-ext#0.10.11
│ │ └── es6-iterator#2.0.0
│ ├── nopt#3.0.6 -> /usr/lib/node_modules/npm/node_modules.bundled/nopt
│ ├── normalize-git-url#3.0.2 -> /usr/lib/node_modules/npm/node_modules.bundled/normalize-git-url
│ ├─┬ normalize-package-data#2.3.5 -> /usr/lib/node_modules/npm/node_modules.bundled/normalize-package-data
│ │ └─┬ is-builtin-module#1.0.0
│ │ └── builtin-modules#1.1.1
│ ├── npm-cache-filename#1.0.2 -> /usr/lib/node_modules/npm/node_modules.bundled/npm-cache-filename
│ ├── npm-install-checks#3.0.0 -> /usr/lib/node_modules/npm/node_modules.bundled/npm-install-checks
│ ├── npm-package-arg#4.2.0 -> /usr/lib/node_modules/npm/node_modules.bundled/npm-package-arg
│ ├─┬ npm-registry-client#7.1.2 -> /usr/lib/node_modules/npm/node_modules.bundled/npm-registry-client
│ │ ├─┬ concat-stream#1.5.1
│ │ │ ├─┬ 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
│ │ └── retry#0.8.0
│ ├── npm-user-validate#0.1.4 -> /usr/lib/node_modules/npm/node_modules.bundled/npm-user-validate
│ ├─┬ npmlog#3.1.2 -> /usr/lib/node_modules/npm/node_modules.bundled/npmlog
│ │ ├─┬ are-we-there-yet#1.1.2
│ │ │ └── delegates#1.0.0
│ │ ├── console-control-strings#1.1.0
│ │ ├─┬ gauge#2.6.0
│ │ │ ├── has-color#0.1.7
│ │ │ ├── object-assign#4.1.0
│ │ │ ├── signal-exit#3.0.0
│ │ │ ├─┬ string-width#1.0.1
│ │ │ │ ├─┬ code-point-at#1.0.0
│ │ │ │ │ └── number-is-nan#1.0.0
│ │ │ │ └─┬ is-fullwidth-code-point#1.0.0
│ │ │ │ └── number-is-nan#1.0.0
│ │ │ └── wide-align#1.1.0
│ │ └── set-blocking#2.0.0
│ ├── once#1.3.3 -> /usr/lib/node_modules/npm/node_modules.bundled/once
│ ├── opener#1.4.1 -> /usr/lib/node_modules/npm/node_modules.bundled/opener
│ ├─┬ osenv#0.1.3 -> /usr/lib/node_modules/npm/node_modules.bundled/osenv
│ │ ├── os-homedir#1.0.1
│ │ └── os-tmpdir#1.0.1
│ ├── path-is-inside#1.0.1 -> /usr/lib/node_modules/npm/node_modules.bundled/path-is-inside
│ ├─┬ read#1.0.7 -> /usr/lib/node_modules/npm/node_modules.bundled/read
│ │ └── mute-stream#0.0.5
│ ├── read-cmd-shim#1.0.1 -> /usr/lib/node_modules/npm/node_modules.bundled/read-cmd-shim
│ ├─┬ read-installed#4.0.3 -> /usr/lib/node_modules/npm/node_modules.bundled/read-installed
│ │ └── util-extend#1.0.3
│ ├─┬ read-package-json#2.0.4 -> /usr/lib/node_modules/npm/node_modules.bundled/read-package-json
│ │ ├─┬ glob#6.0.4
│ │ │ ├─┬ minimatch#3.0.0
│ │ │ │ └─┬ brace-expansion#1.1.3
│ │ │ │ ├── balanced-match#0.3.0
│ │ │ │ └── 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 -> /usr/lib/node_modules/npm/node_modules.bundled/read-package-tree
│ ├─┬ readable-stream#2.1.4 -> /usr/lib/node_modules/npm/node_modules.bundled/readable-stream
│ │ ├── 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 -> /usr/lib/node_modules/npm/node_modules.bundled/readdir-scoped-modules
│ ├── realize-package-specifier#3.0.3 -> /usr/lib/node_modules/npm/node_modules.bundled/realize-package-specifier
│ ├─┬ request#2.72.0 -> /usr/lib/node_modules/npm/node_modules.bundled/request
│ │ ├── aws-sign2#0.6.0
│ │ ├─┬ aws4#1.3.2
│ │ │ └─┬ lru-cache#4.0.1
│ │ │ ├── pseudomap#1.0.2
│ │ │ └── yallist#2.0.0
│ │ ├─┬ bl#1.1.2
│ │ │ └─┬ readable-stream#2.0.6
│ │ │ ├── core-util-is#1.0.2
│ │ │ ├── isarray#1.0.0
│ │ │ ├── process-nextick-args#1.0.6
│ │ │ ├── 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
│ │ │ └── async#1.5.2
│ │ ├─┬ 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.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.2.2
│ │ │ │ ├── extsprintf#1.0.2
│ │ │ │ ├── json-schema#0.2.2
│ │ │ │ └── verror#1.3.6
│ │ │ └─┬ sshpk#1.7.4
│ │ │ ├── asn1#0.2.3
│ │ │ ├─┬ dashdash#1.13.0
│ │ │ │ └── assert-plus#1.0.0
│ │ │ ├── ecc-jsbn#0.1.1
│ │ │ ├── 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.10
│ │ │ └── mime-db#1.22.0
│ │ ├── node-uuid#1.4.7
│ │ ├── oauth-sign#0.8.1
│ │ ├── qs#6.1.0
│ │ ├── stringstream#0.0.5
│ │ ├── tough-cookie#2.2.2
│ │ └── tunnel-agent#0.4.2
│ ├── retry#0.9.0 -> /usr/lib/node_modules/npm/node_modules.bundled/retry
│ ├── rimraf#2.5.2 -> /usr/lib/node_modules/npm/node_modules.bundled/rimraf
│ ├── semver#5.1.0 -> /usr/lib/node_modules/npm/node_modules.bundled/semver
│ ├── sha#2.0.1 -> /usr/lib/node_modules/npm/node_modules.bundled/sha
│ ├── slide#1.1.6 -> /usr/lib/node_modules/npm/node_modules.bundled/slide
│ ├── sorted-object#2.0.0 -> /usr/lib/node_modules/npm/node_modules.bundled/sorted-object
│ ├── strip-ansi#3.0.1 -> /usr/lib/node_modules/npm/node_modules.bundled/strip-ansi
│ ├─┬ tar#2.2.1 -> /usr/lib/node_modules/npm/node_modules.bundled/tar
│ │ └── block-stream#0.0.8
│ ├── text-table#0.2.0 -> /usr/lib/node_modules/npm/node_modules.bundled/text-table
│ ├── uid-number#0.0.6 -> /usr/lib/node_modules/npm/node_modules.bundled/uid-number
│ ├── umask#1.1.0 -> /usr/lib/node_modules/npm/node_modules.bundled/umask
│ ├─┬ unique-filename#1.1.0 -> /usr/lib/node_modules/npm/node_modules.bundled/unique-filename
│ │ └── unique-slug#2.0.0
│ ├── unpipe#1.0.0 -> /usr/lib/node_modules/npm/node_modules.bundled/unpipe
│ ├─┬ validate-npm-package-license#3.0.1 -> /usr/lib/node_modules/npm/node_modules.bundled/validate-npm-package-license
│ │ ├─┬ 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 -> /usr/lib/node_modules/npm/node_modules.bundled/validate-npm-package-name
│ │ └── builtins#0.0.7
│ ├─┬ which#1.2.10 -> /usr/lib/node_modules/npm/node_modules.bundled/which
│ │ └── isexe#1.1.2
│ ├── wrappy#1.0.2 -> /usr/lib/node_modules/npm/node_modules.bundled/wrappy
│ └── write-file-atomic#1.1.4 -> /usr/lib/node_modules/npm/node_modules.bundled/write-file-atomic
└── which#1.0.5
Why do the Specs behave differently on the two platforms?
I am using grunt (with yeoman), and I added bower components via this command:
bower install `package_name` --save
This will add them into the index.html and karma.conf.js automatically. But there is a component named adm-dtp which was not added automatically (even when I used above command). I add this manually to karma.conf.js and everything works.
So the generic answer should be check karma.conf.js and be sure that everything is loaded correctly. this link is related. And if you use grunt and yeoman add them after //end bower, because that part will be overwritten after running grunt test.
karma.conf.js:
config.set({
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// base path, that will be used to resolve files and exclude
basePath: '../',
// testing framework to use (jasmine/mocha/qunit/...)
// as well as any additional frameworks (requirejs/chai/sinon/...)
frameworks: [
'jasmine'
],
// list of files / patterns to load in the browser
files: [
'app/scripts/persian.min.js',
// bower:js
'bower_components/jquery/dist/jquery.js',
'bower_components/angular/angular.js',
'bower_components/bootstrap/dist/js/bootstrap.js',
'bower_components/angular-animate/angular-animate.js',
'bower_components/angular-aria/angular-aria.js',
'bower_components/angular-cookies/angular-cookies.js',
'bower_components/angular-messages/angular-messages.js',
'bower_components/angular-resource/angular-resource.js',
'bower_components/angular-route/angular-route.js',
'bower_components/angular-sanitize/angular-sanitize.js',
'bower_components/angular-touch/angular-touch.js',
'bower_components/angularLocalStorage/dist/angularLocalStorage.min.js',
'bower_components/ngmap/build/scripts/ng-map.js',
'bower_components/angular-loading-bar/build/loading-bar.js',
'bower_components/angular-persian/dist/angularpersian.js',
'bower_components/caman/dist/caman.min.js',
'bower_components/caman/dist/caman.full.min.js',
'bower_components/angular-xeditable/dist/js/xeditable.js',
'bower_components/moment/moment.js',
'bower_components/angular-mocks/angular-mocks.js',
// endbower
// AFTER END BOWER ADDING BOWER COMPONENTS NOT ADDED AUTOMATICLY:
'bower_components/adm-dtp/dist/ADM-dateTimePicker.min.js',
'app/scripts/**/*.js',
'test/mock/**/*.js',
'test/spec/**/*.js',
'app/scripts/controllers/bootstrapController.js'
],
// list of files / patterns to exclude
exclude: [
],
// web server port
port: 8082,
// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
browsers: [
'PhantomJS',
],
// Which plugins to enable
plugins: [
'karma-phantomjs-launcher',
'karma-jasmine'
],
// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: false,
colors: true,
// level of logging
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
logLevel: config.LOG_DISABLE,
// Uncomment the following lines if you are using grunt's server to run the tests
proxies: {
'/': 'http://localhost:9000/'
},
// URL root prevent conflicts with the site root
// urlRoot: '_karma_'
});

How to easily verify correct npm dependencies installed?

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

The provided URI "https://mystorageaccountname.blob.core.windows.net/" is invalid

I have some problems writing some files (from debian with the azure cli client) to my storage account. The following error is which i am receiving:
root#w01:/scripts# azure storage blob upload -a "mystorageaccountname" -k "Hewaebaweb0F2+E6qbSQbeabewabpr/3ZhKbdawbwabsRINSyQerIA==" "w01-20140213.tar.gz" "backup" "w01-20140213.tar.gz"
info: Executing command storage blob upload
error: The provided URI "https://mystorageaccountname.blob.core.windows.net/" is invalid.
info: Error information has been recorded to azure.err
error: storage blob upload command failed
I just updated my node packages on the machine to the latest version (npm update -g). This brings me to the following packages:
ro
root#w01:/scripts# npm -g list
/usr/local/lib
├─┬ azure#0.8.1
│ ├─┬ azure-common#0.9.1-pre.2
│ │ ├── dateformat#1.0.2-1.2.3
│ │ ├── duplexer#0.1.1
│ │ ├── envconf#0.0.4
│ │ ├─┬ request#2.27.0
│ │ │ ├── aws-sign#0.3.0
│ │ │ ├── cookie-jar#0.3.0
│ │ │ ├── forever-agent#0.5.2
│ │ │ ├─┬ form-data#0.1.2
│ │ │ │ ├── async#0.2.10
│ │ │ │ └─┬ combined-stream#0.0.4
│ │ │ │ └── delayed-stream#0.0.5
│ │ │ ├─┬ hawk#1.0.0
│ │ │ │ ├── boom#0.4.2
│ │ │ │ ├── cryptiles#0.2.2
│ │ │ │ ├── hoek#0.9.1
│ │ │ │ └── sntp#0.2.4
│ │ │ ├─┬ http-signature#0.10.0
│ │ │ │ ├── asn1#0.1.11
│ │ │ │ ├── assert-plus#0.1.2
│ │ │ │ └── ctype#0.5.2
│ │ │ ├── json-stringify-safe#5.0.0
│ │ │ ├── mime#1.2.11
│ │ │ ├── node-uuid#1.4.1
│ │ │ ├── oauth-sign#0.3.0
│ │ │ ├── qs#0.6.6
│ │ │ └── tunnel-agent#0.3.0
│ │ ├── through#2.3.4
│ │ ├── tunnel#0.0.3
│ │ ├── underscore#1.4.4
│ │ ├── validator#3.1.0
│ │ ├─┬ xml2js#0.2.7
│ │ │ └── sax#0.5.2
│ │ └── xmlbuilder#0.4.3
│ ├── azure-mgmt#0.9.1-pre.2
│ ├── azure-mgmt-compute#0.9.1-pre.2
│ ├─┬ azure-mgmt-sb#0.9.1-pre.2
│ │ └── underscore#1.6.0
│ ├─┬ azure-mgmt-sql#0.9.1-pre.2
│ │ └── underscore#1.6.0
│ ├── azure-mgmt-storage#0.9.1-pre.2
│ ├── azure-mgmt-vnet#0.9.1-pre.2
│ ├─┬ azure-mgmt-website#0.9.1-pre.2
│ │ └── underscore#1.6.0
│ ├── mime#1.2.11
│ ├── mpns#2.0.1
│ ├── node-uuid#1.2.0
│ ├─┬ request#2.27.0
│ │ ├── aws-sign#0.3.0
│ │ ├── cookie-jar#0.3.0
│ │ ├── forever-agent#0.5.2
│ │ ├─┬ form-data#0.1.2
│ │ │ ├── async#0.2.10
│ │ │ └─┬ combined-stream#0.0.4
│ │ │ └── delayed-stream#0.0.5
│ │ ├─┬ hawk#1.0.0
│ │ │ ├── boom#0.4.2
│ │ │ ├── cryptiles#0.2.2
│ │ │ ├── hoek#0.9.1
│ │ │ └── sntp#0.2.4
│ │ ├─┬ http-signature#0.10.0
│ │ │ ├── asn1#0.1.11
│ │ │ ├── assert-plus#0.1.2
│ │ │ └── ctype#0.5.2
│ │ ├── json-stringify-safe#5.0.0
│ │ ├── mime#1.2.11
│ │ ├── node-uuid#1.4.1
│ │ ├── oauth-sign#0.3.0
│ │ ├── qs#0.6.6
│ │ └── tunnel-agent#0.3.0
│ ├── underscore#1.4.4
│ └── wns#0.5.3
├─┬ azure-cli#0.7.4
│ ├── async#0.2.7
│ ├─┬ azure#0.7.17
│ │ ├── dateformat#1.0.2-1.2.3
│ │ ├── duplexer#0.1.1
│ │ ├── envconf#0.0.4
│ │ ├── mime#1.2.11
│ │ ├── mpns#2.1.0
│ │ ├── node-uuid#1.2.0
│ │ ├─┬ request#2.27.0
│ │ │ ├── aws-sign#0.3.0
│ │ │ ├── cookie-jar#0.3.0
│ │ │ ├── forever-agent#0.5.2
│ │ │ ├─┬ form-data#0.1.2
│ │ │ │ ├── async#0.2.10
│ │ │ │ └─┬ combined-stream#0.0.4
│ │ │ │ └── delayed-stream#0.0.5
│ │ │ ├─┬ hawk#1.0.0
│ │ │ │ ├── boom#0.4.2
│ │ │ │ ├── cryptiles#0.2.2
│ │ │ │ ├── hoek#0.9.1
│ │ │ │ └── sntp#0.2.4
│ │ │ ├─┬ http-signature#0.10.0
│ │ │ │ ├── asn1#0.1.11
│ │ │ │ ├── assert-plus#0.1.2
│ │ │ │ └── ctype#0.5.2
│ │ │ ├── json-stringify-safe#5.0.0
│ │ │ ├── node-uuid#1.4.1
│ │ │ ├── oauth-sign#0.3.0
│ │ │ ├── qs#0.6.6
│ │ │ └── tunnel-agent#0.3.0
│ │ ├── through#2.3.4
│ │ ├── tunnel#0.0.3
│ │ ├── underscore#1.6.0
│ │ ├── validator#3.2.1
│ │ ├── wns#0.5.3
│ │ ├─┬ xml2js#0.4.1
│ │ │ └── sax#0.5.8
│ │ └── xmlbuilder#2.1.0
│ ├── colors#0.6.2
│ ├─┬ commander#1.0.4
│ │ └── keypress#0.1.0
│ ├─┬ cucumber#0.3.1
│ │ ├─┬ browserify#1.15.5
│ │ │ ├─┬ buffer-browserify#0.0.5
│ │ │ │ └── base64-js#0.0.2
│ │ │ ├── commondir#0.0.1
│ │ │ ├── crypto-browserify#0.4.0
│ │ │ ├── deputy#0.0.4
│ │ │ ├─┬ detective#0.2.1
│ │ │ │ └── esprima#0.9.9
│ │ │ ├─┬ http-browserify#0.1.13
│ │ │ │ ├── Base64#0.1.4
│ │ │ │ └─┬ concat-stream#1.0.1
│ │ │ │ └─┬ bops#0.0.6
│ │ │ │ ├── base64-js#0.0.2
│ │ │ │ └── to-utf8#0.0.1
│ │ │ ├── nub#0.0.0
│ │ │ ├─┬ optimist#0.3.7
│ │ │ │ └── wordwrap#0.0.2
│ │ │ ├── resolve#0.2.8
│ │ │ ├─┬ syntax-error#0.0.1
│ │ │ │ └── esprima#0.9.9
│ │ │ └── vm-browserify#0.0.1
│ │ ├── coffee-script#1.4.0
│ │ ├─┬ connect#2.3.2
│ │ │ ├── cookie#0.0.3
│ │ │ ├── crc#0.2.0
│ │ │ ├── debug#0.7.3
│ │ │ ├── formidable#1.0.9
│ │ │ ├── mime#1.2.4
│ │ │ └── qs#0.4.2
│ │ ├── cucumber-html#0.2.2
│ │ ├── gherkin#2.11.5
│ │ ├─┬ jasmine-node#1.4.0
│ │ │ ├─┬ gaze#0.3.4
│ │ │ │ ├─┬ fileset#0.1.5
│ │ │ │ │ └─┬ glob#3.2.6
│ │ │ │ │ └── inherits#2.0.1
│ │ │ │ └─┬ minimatch#0.2.12
│ │ │ │ ├── lru-cache#2.3.1
│ │ │ │ └── sigmund#1.0.0
│ │ │ ├── jasmine-reporters#0.2.1
│ │ │ └── requirejs#2.1.9
│ │ ├── mkdirp#0.3.3
│ │ ├─┬ nopt#1.0.10
│ │ │ └── abbrev#1.0.4
│ │ ├─┬ rimraf#2.0.2
│ │ │ └── graceful-fs#1.1.14
│ │ ├── underscore#1.3.3
│ │ └── walkdir#0.0.4
│ ├── easy-table#0.0.1
│ ├── eyes#0.1.8
│ ├── github#0.1.6
│ ├─┬ jshint#2.3.0
│ │ ├─┬ cli#0.4.5
│ │ │ └─┬ glob#3.2.6
│ │ │ └── inherits#2.0.1
│ │ ├── console-browserify#0.1.6
│ │ ├─┬ minimatch#0.2.12
│ │ │ ├── lru-cache#2.3.1
│ │ │ └── sigmund#1.0.0
│ │ └── shelljs#0.1.4
│ ├─┬ kuduscript#0.1.5
│ │ ├─┬ commander#1.1.1
│ │ │ └── keypress#0.1.0
│ │ └── streamline#0.4.11
│ ├─┬ mocha#1.14.0
│ │ ├── commander#2.0.0
│ │ ├── debug#0.7.3
│ │ ├── diff#1.0.7
│ │ ├─┬ glob#3.2.3
│ │ │ ├── graceful-fs#2.0.1
│ │ │ ├── inherits#2.0.1
│ │ │ └─┬ minimatch#0.2.12
│ │ │ ├── lru-cache#2.3.1
│ │ │ └── sigmund#1.0.0
│ │ ├── growl#1.7.0
│ │ ├─┬ jade#0.26.3
│ │ │ ├── commander#0.6.1
│ │ │ └── mkdirp#0.3.0
│ │ └── mkdirp#0.3.5
│ ├─┬ nock#0.16.0
│ │ └── propagate#0.2.2
│ ├── node-uuid#1.2.0
│ ├── omelette#0.1.0
│ ├── should#2.0.2
│ ├─┬ sinon#1.7.3
│ │ └─┬ buster-format#0.5.6
│ │ └── buster-core#0.6.4
│ ├── streamline#0.4.5
│ ├── tunnel#0.0.2
│ ├── underscore#1.4.4
│ ├─┬ winston#0.6.2
│ │ ├── async#0.1.22
│ │ ├── colors#0.6.2
│ │ ├── cycle#1.0.3
│ │ ├── eyes#0.1.8
│ │ ├── pkginfo#0.2.3
│ │ ├── request#2.9.203
│ │ └── stack-trace#0.0.8
│ ├── winston-memory#0.1.0
│ ├─┬ xml2js#0.1.14
│ │ └── sax#0.6.0
│ └── xmlbuilder#0.4.3
├── duplexer#0.1.1
├─┬ npm#1.4.0
│ ├── abbrev#1.0.4
│ ├── ansi#0.2.1
│ ├── ansicolors#0.3.2
│ ├── ansistyles#0.1.3
│ ├── archy#0.0.2
│ ├── block-stream#0.0.7
│ ├── child-process-close#0.1.1
│ ├── chmodr#0.1.0
│ ├── chownr#0.0.1
│ ├── cmd-shim#1.1.1
│ ├── columnify#0.1.2
│ ├── editor#0.0.5
│ ├── fstream#0.1.25
│ ├─┬ fstream-npm#0.1.6
│ │ └── fstream-ignore#0.0.7
│ ├── github-url-from-git#1.1.1
│ ├── github-url-from-username-repo#0.0.2
│ ├── glob#3.2.7
│ ├── graceful-fs#2.0.1
│ ├── inherits#2.0.1
│ ├── ini#1.1.0
│ ├─┬ init-package-json#0.0.14
│ │ └── promzard#0.2.1
│ ├── lockfile#0.4.2
│ ├── lru-cache#2.5.0
│ ├─┬ minimatch#0.2.14
│ │ └── sigmund#1.0.0
│ ├── mkdirp#0.3.5
│ ├── node-gyp#0.12.2
│ ├── nopt#2.1.2
│ ├── npm-install-checks#1.0.0
│ ├── npm-registry-client#0.4.0
│ ├── npm-user-validate#0.0.3
│ ├─┬ npmconf#0.1.12
│ │ └─┬ config-chain#1.1.8
│ │ └── proto-list#1.2.2
│ ├── npmlog#0.0.6
│ ├── once#1.3.0
│ ├── opener#1.3.0
│ ├── osenv#0.0.3
│ ├── path-is-inside#1.0.0
│ ├─┬ read#1.0.5
│ │ └── mute-stream#0.0.4
│ ├── read-installed#0.2.5
│ ├─┬ read-package-json#1.1.7
│ │ └── normalize-package-data#0.2.9
│ ├─┬ request#2.30.0
│ │ ├── aws-sign2#0.5.0
│ │ ├── forever-agent#0.5.0
│ │ ├─┬ form-data#0.1.2
│ │ │ ├── async#0.2.9
│ │ │ └─┬ combined-stream#0.0.4
│ │ │ └── delayed-stream#0.0.5
│ │ ├─┬ hawk#1.0.0
│ │ │ ├── boom#0.4.2
│ │ │ ├── cryptiles#0.2.2
│ │ │ ├── hoek#0.9.1
│ │ │ └── sntp#0.2.4
│ │ ├─┬ http-signature#0.10.0
│ │ │ ├── asn1#0.1.11
│ │ │ ├── assert-plus#0.1.2
│ │ │ └── ctype#0.5.2
│ │ ├── json-stringify-safe#5.0.0
│ │ ├── mime#1.2.11
│ │ ├── node-uuid#1.4.1
│ │ ├── oauth-sign#0.3.0
│ │ ├── qs#0.6.6
│ │ ├─┬ tough-cookie#0.9.15
│ │ │ └── punycode#1.2.3
│ │ └── tunnel-agent#0.3.0
│ ├── retry#0.6.0
│ ├── rimraf#2.2.6
│ ├── semver#2.2.1
│ ├─┬ sha#1.2.3
│ │ └── readable-stream#1.0.24
│ ├── slide#1.1.5
│ ├── tar#0.1.19
│ ├── text-table#0.2.0
│ ├── uid-number#0.0.3
│ └── which#1.0.5
└── through#2.3.4
At last i have the exact error as writting in my azure.err as mentioned in the first block.
Thu Feb 13 2014 09:17:17 GMT+0100 (CET):
2 { [Error: The provided URI "https://mystorageaccountname.blob.core.windows.net/" is invalid.]
3 stack: [Getter/Setter],
4 __frame: undefined,
5 rawStack: [Getter] }
6 Error: The provided URI "https://mystorageaccountname.blob.core.windows.net/" is invalid.
7 at exports.isValidUri (/usr/local/lib/node_modules/azure-cli/node_modules/azure/lib/util/validate.js:52:11)
8 at Array.0 (/usr/local/lib/node_modules/azure-cli/node_modules/azure/lib/services/core/servicesettings.js:113:25)
9 at Object.exports.matchedSpecification (/usr/local/lib/node_modules/azure-cli/node_modules/azure/lib/services/core/servicesettings.js:226:54)
10 at Function.StorageServiceSettings.createFromSettings (/usr/local/lib/node_modules/azure-cli/node_modules/azure/lib/services/core/storageservicesettings.js:254:34)
11 at Function.StorageServiceSettings.createExplicitlyOrFromEnvironment (/usr/local/lib/node_modules/azure-cli/node_modules/azure/lib/services/core/storageservicesettings.js:335:55)
12 at Function.StorageServiceClient.getStorageSettings (/usr/local/lib/node_modules/azure-cli/node_modules/azure/lib/services/core/storageserviceclient.js:75:53)
13 at new BlobService (/usr/local/lib/node_modules/azure-cli/node_modules/azure/lib/services/blob/blobservice.js:84:53)
14 at Object.exports.createBlobService (/usr/local/lib/node_modules/azure-cli/node_modules/azure/lib/azure.js:70:10)
15 at Object.StorageUtil.getBlobService (/usr/local/lib/node_modules/azure-cli/lib/util/storage.util._js:106:21)
16 at getBlobServiceClient (/usr/local/lib/node_modules/azure-cli/lib/commands/storage.blob._js:217:39)
I hope there is someone with an idea because i can not even use the Azure service this way if i cant export a blob file to the storage.
Thanks in advance
try another name for your account storage "mystorageaccountname" may be taken before
Thanks for the replies. Indeed i changed the name of my storage account because i'd rather dont have it public. It was all lower case without any special characters or whatsoever.
I executed the following steps
npm remove azure-cli -g
npm cache clear
npm install azure-cli -g
Now everything is working again. Even though there are still some huge issues with the CLI client because i can not use it from an Azure Micro Instance. After a while the command is killed while uploading a 200MB file.
I have people at Microsoft looking at it so maybe its good that i refer to that too:
https://github.com/WindowsAzure/azure-sdk-tools-xplat/issues/1063
But after reinstalling the command is running again without the error mentioned above.

Resources