Error Phonegap App with Mobile Angular Ui - node.js

I'm following this guide
http://mobileangularui.com/blog/your-first-phonegap-app-with-mobile-angular-ui/#why-not-just-twitter-bootstrap-and-angular-ui-
but when i run this code
npm install -g bower yo gulp generator-mobileangularui
I receive this error...
C:\Users\Desktop\Sorgente\weather>npm install -g bower yo gulp
generator-mobileangularui
> npm WARN engine yo#1.4.6: wanted: {"node":">=0.10.0","npm":">=2.1.0"}
(current:
{"node":"v0.10.29","npm":"1.4.14"})
|
> buffertools#2.1.2 install C:\Users\AppData\Roaming\npm\node_m
odules\generator-mobileangularui\node_modules\slug\node_modules\unicode\node_mod
ules\bufferstream\node_modules\buffertools
> node-gyp rebuild
C:\Users\AppData\Roaming\npm\node_modules\generator-mobileangul
arui\node_modules\slug\node_modules\unicode\node_modules\bufferstream\node_modul
es\buffertools>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\
..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe".
To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visua
l Studio 2005 or 3) add the location of the component to the system path if it
is installed elsewhere. [C:\Users\AppData\Roaming\npm\node_modules\generator-mobileangularui\node_modules\slug\n
ode_modules\unicode\node_modules\bufferstream\node_modules\buffertools\build\bi
nding.sln]
gyp ERR! build error
gyp ERR! stack Error: `C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\
npm\node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:809:
12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modu
les\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\AppData\Roaming\npm\node_modules\generato
r-mobileangularui\node_modules\slug\node_modules\unicode\node_modules\bufferstre
am\node_modules\buffertools
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok
npm WARN optional dep failed, continuing buffertools#2.1.2
|
> unicode#0.6.1 postinstall C:\Users\AppData\Roaming\npm\node_m
odules\generator-mobileangularui\node_modules\slug\node_modules\unicode
> node install.js
try to read file /usr/share/unicode/UnicodeData.txt .
Warning: using slow naiv Buffer.indexOf function!
`npm install buffertools` to speed things up.
/usr/share/unicode/UnicodeData.txt not found.
try to read file /usr/share/unicode-data/UnicodeData.txt .
/usr/share/unicode-data/UnicodeData.txt not found.
try to read file UnicodeData.txt .
UnicodeData.txt not found.
try to download .
GET unicode.org:80/Public/UNIDATA/UnicodeData.txt
fetching .
C:\Users\AppData\Roaming\npm\gulp -> C:\Users\
AppData\Roaming\npm\node_modules\gulp\bin\gulp.js
C:\Users\AppData\Roaming\npm\yo -> C:\Users\Ap
pData\Roaming\npm\node_modules\yo\lib\cli.js
> yo#1.4.6 postinstall C:\Users\AppData\Roaming\npm\node_module
s\yo
> yodoctor
/
Yeoman Doctor
Running sanity checks on your system
V Global configuration file is valid
V NODE_PATH matches the npm root
V No .bowerrc file in home directory
V No .yo-rc.json file in home directory
Everything looks all right!
C:\Users\AppData\Roaming\npm\bower -> C:\Users
\AppData\Roaming\npm\node_modules\bower\bin\bower
gulp#3.8.11 C:\Users\AppData\Roaming\npm\node_modules\gulp
├── interpret#0.3.10
├── pretty-hrtime#0.2.2
├── deprecated#0.0.1
├── archy#1.0.0
├── tildify#1.0.0 (user-home#1.1.1)
├── minimist#1.1.1
├── v8flags#2.0.5 (user-home#1.1.1)
├── semver#4.3.4
├── chalk#0.5.1 (ansi-styles#1.1.0, supports-color#0.2.0, escape-string-regexp#1
.0.3, has-ansi#0.1.0, strip-ansi#0.3.0)
├── orchestrator#0.3.7 (stream-consume#0.1.0, sequencify#0.0.7, end-of-stream#0.
1.5)
├── liftoff#2.0.3 (extend#2.0.1, flagged-respawn#0.3.1, resolve#1.1.6, findup-sy
nc#0.2.1)
├── vinyl-fs#0.3.13 (graceful-fs#3.0.6, strip-bom#1.0.0, vinyl#0.4.6, defaults#1
.0.2, mkdirp#0.5.0, glob-stream#3.1.18, glob-watcher#0.0.6, through2#0.6.5)
└── gulp-util#3.0.4 (array-uniq#1.0.2, array-differ#1.0.0, beeper#1.0.0, lodash.
_reevaluate#3.0.0, object-assign#2.0.0, lodash._reescape#3.0.0, lodash._reinterp
olate#3.0.0, replace-ext#0.0.1, vinyl#0.4.6, chalk#1.0.0, dateformat#1.0.11, lod
ash.template#3.5.1, through2#0.6.5, multipipe#0.1.2)
generator-mobileangularui#1.2.1 C:\Users\AppData\Roaming\npm\no
de_modules\generator-mobileangularui
├── chalk#0.4.0 (ansi-styles#1.0.0, has-color#0.1.7, strip-ansi#0.1.1)
├── yosay#0.1.0 (pad-component#0.0.1, word-wrap#0.1.3, minimist#0.0.9)
├── slug#0.5.0 (unicode#0.6.1)
└── yeoman-generator#0.16.0 (dargs#0.1.0, diff#1.0.8, debug#0.7.4, isbinaryfile#
2.0.4, class-extend#0.1.1, rimraf#2.2.8, async#0.2.10, findup-sync#0.1.3, mime#1
.2.11, text-table#0.2.0, mkdirp#0.3.5, iconv-lite#0.2.11, shelljs#0.2.6, lodash#
2.4.2, underscore.string#2.3.3, glob#3.2.11, file-utils#0.1.5, request#2.30.0, c
heerio#0.13.1, inquirer#0.4.1, download#0.1.19)
yo#1.4.6 C:\Users\AppData\Roaming\npm\node_modules\yo
├── titleize#1.0.0
├── array-uniq#1.0.2
├── figures#1.3.5
├── user-home#1.1.1
├── humanize-string#1.0.1 (decamelize#1.0.0)
├── opn#1.0.2
├── string-length#1.0.0 (strip-ansi#2.0.1)
├── async#0.9.0
├── sort-on#1.2.0 (dot-prop#2.0.0)
├── yeoman-character#1.0.1 (supports-color#1.3.1)
├── cross-spawn#0.2.9 (lru-cache#2.6.2)
├── findup#0.1.5 (commander#2.1.0, colors#0.6.2)
├── root-check#1.0.0 (downgrade-root#1.1.0, sudo-block#1.2.0)
├── yosay#1.0.3 (ansi-styles#2.0.1, word-wrap#1.0.3, ansi-regex#1.1.1, strip-ans
i#2.0.1, pad-component#0.0.1, taketalk#1.0.0, minimist#1.1.1)
├── chalk#1.0.0 (escape-string-regexp#1.0.3, ansi-styles#2.0.1, supports-color#1
.3.1, strip-ansi#2.0.1, has-ansi#1.0.3)
├── meow#3.1.0 (object-assign#2.0.0, camelcase-keys#1.0.0, indent-string#1.2.1,
minimist#1.1.1)
├── update-notifier#0.3.2 (is-npm#1.0.0, latest-version#1.0.0, semver-diff#2.0.0
)
├── npm-keyword#1.1.1 (registry-url#3.0.3)
├── package-json#1.1.0 (registry-url#3.0.3)
├── got#2.9.2 (lowercase-keys#1.0.0, is-stream#1.0.1, timed-out#2.0.0, prepend-h
ttp#1.0.1, nested-error-stacks#1.0.0, infinity-agent#2.0.3, statuses#1.2.1, obje
ct-assign#2.0.0, read-all-stream#2.1.2, duplexify#3.3.0)
├── fullname#1.1.0 (npmconf#2.1.1)
├── configstore#0.3.2 (xdg-basedir#1.0.1, object-assign#2.0.0, osenv#0.1.0, grac
eful-fs#3.0.6, uuid#2.0.1, mkdirp#0.5.0, js-yaml#3.3.0)
├── insight#0.5.3 (object-assign#2.0.0, lodash.debounce#3.0.3, tough-cookie#0.12
.1, os-name#1.0.3, request#2.55.0)
├── yeoman-doctor#1.3.2 (object-values#1.0.0, log-symbols#1.0.2, each-async#1.1.
1, twig#0.7.2)
├── yeoman-environment#1.2.5 (untildify#2.0.0, log-symbols#1.0.2, escape-string-
regexp#1.0.3, diff#1.4.0, text-table#0.2.0, debug#2.1.3, grouped-queue#0.3.0, gl
obby#1.2.0, mem-fs#1.1.0)
├── lodash#3.8.0
└── inquirer#0.8.3 (cli-width#1.0.1, ansi-regex#1.1.1, through#2.3.7, readline2#
0.1.1, rx#2.5.2)
bower#1.4.1 C:\Users\AppData\Roaming\npm\node_modules\bower
├── is-root#1.0.0
├── junk#1.0.1
├── stringify-object#1.0.1
├── chmodr#0.1.0
├── which#1.0.9
├── abbrev#1.0.5
├── rimraf#2.3.3
├── user-home#1.1.1
├── lockfile#1.0.0
├── opn#1.0.2
├── bower-logger#0.2.2
├── bower-endpoint-parser#0.2.2
├── graceful-fs#3.0.6
├── archy#1.0.0
├── nopt#3.0.1
├── retry#0.6.1
├── lru-cache#2.6.2
├── semver#2.3.2
├── p-throttler#0.1.1 (q#0.9.7)
├── tmp#0.0.24
├── request-progress#0.3.1 (throttleit#0.0.2)
├── q#1.3.0
├── shell-quote#1.4.3 (array-filter#0.0.1, array-reduce#0.0.0, array-map#0.0.0,
jsonify#0.0.0)
├── chalk#1.0.0 (escape-string-regexp#1.0.3, ansi-styles#2.0.1, supports-color#1
.3.1, strip-ansi#2.0.1, has-ansi#1.0.3)
├── mkdirp#0.5.0 (minimist#0.0.8)
├── promptly#0.2.0 (read#1.0.5)
├── bower-json#0.4.0 (intersect#0.0.3, deep-extend#0.2.11, graceful-fs#2.0.3)
├── insight#0.5.3 (object-assign#2.0.0, lodash.debounce#3.0.3, async#0.9.0, toug
h-cookie#0.12.1, os-name#1.0.3)
├── glob#4.5.3 (once#1.3.2, inflight#1.0.4, inherits#2.0.1, minimatch#2.0.7)
├── fstream#1.0.5 (inherits#2.0.1)
├── fstream-ignore#1.0.2 (inherits#2.0.1, minimatch#2.0.7)
├── cardinal#0.4.4 (ansicolors#0.2.1, redeyed#0.4.4)
├── decompress-zip#0.1.0 (mkpath#0.1.0, touch#0.0.3, binary#0.3.0, readable-stre
am#1.1.13)
├── tar-fs#1.5.0 (pump#1.0.0, tar-stream#1.1.4)
├── github#0.2.4 (mime#1.3.4)
├── request#2.53.0 (caseless#0.9.0, forever-agent#0.5.2, aws-sign2#0.5.0, tunnel
-agent#0.4.0, oauth-sign#0.6.0, json-stringify-safe#5.0.0, isstream#0.1.2, strin
gstream#0.0.4, qs#2.3.3, node-uuid#1.4.3, combined-stream#0.0.7, mime-types#2.0.
11, form-data#0.2.0, http-signature#0.10.1, hawk#2.3.1, tough-cookie#1.1.0, bl#0
.9.4)
├── update-notifier#0.3.2 (is-npm#1.0.0, string-length#1.0.0, semver-diff#2.0.0,
latest-version#1.0.0)
├── bower-registry-client#0.3.0 (rimraf#2.2.8, request-replay#0.2.0, graceful-fs
#2.0.3, lru-cache#2.3.1, mkdirp#0.3.5, async#0.2.10, request#2.51.0)
├── mout#0.11.0
├── handlebars#2.0.0 (optimist#0.3.7, uglify-js#2.3.6)
├── bower-config#0.6.1 (osenv#0.0.3, graceful-fs#2.0.3, optimist#0.6.1, mout#0.9
.1)
├── configstore#0.3.2 (object-assign#2.0.0, xdg-basedir#1.0.1, osenv#0.1.0, uuid
#2.0.1, js-yaml#3.3.0)
└── inquirer#0.8.0 (figures#1.3.5, ansi-regex#1.1.1, mute-stream#0.0.4, through#
2.3.7, readline2#0.1.1, chalk#0.5.1, lodash#2.4.2, rx#2.5.2, cli-color#0.3.3)
C:\Users\Desktop\Sorgente\weather>yo mobileangularui
Error: Cannot find module 'unicode/category/So'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at symbols (C:\Users\AppData\Roaming\npm\node_modules\gener
ator-mobileangularui\node_modules\slug\slug.js:6:16)
at C:\Users\AppData\Roaming\npm\node_modules\generator-mobi
leangularui\node_modules\slug\slug.js:123:5
at Object.<anonymous> (C:\Users\AppData\Roaming\npm\node_mo
dules\generator-mobileangularui\node_modules\slug\slug.js:130:2)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
I installed the .NET Framework 2.0 SDK but I have the same problem...How can fix it???
My versions:
C:\Users\bla>npm -v
1.4.14
C:\Users\bla>node -v
v0.10.29
C:\Users\bla>cordova -v
4.3.0

Try running:
node-gyp rebuild --msvs-version=2012
Also works with:
--msvs-version=2013

Related

Angular2 Cli installation problems

I want to give a shot at angular 2 so I'm working to install angular2 cli now, but when I install it and then run ng new newapp , it awkwardly opens the command line and says something about 'mg' (not even 'ng').
Here's what happens when I run 'ng new myapp'
I'm running sudo npm install -g angular-cli#latest which gives the following output:
npm WARN engine angular-cli#1.0.0-beta.19-3: wanted: {"node":">= 4.1.0","npm":">= 3.0.0"} (current: {"node":"4.6.1","npm":"2.15.9"})
npm WARN engine #ngtools/webpack#1.1.4: wanted: {"node":">= 4.1.0","npm":">= 3.0.0"} (current: {"node":"4.6.1","npm":"2.15.9"})
npm WARN engine #angular-cli/ast-tools#1.0.7: wanted: {"node":">= 4.1.0","npm":">= 3.0.0"} (current: {"node":"4.6.1","npm":"2.15.9"})
npm WARN optional dep failed, continuing fsevents#1.0.15
npm WARN deprecated graceful-fs#1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs#^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
> execSync#1.0.2 install /home/user/.npm-packages/lib/node_modules/angular-cli/node_modules/angular2-template-loader/node_modules/codecov/node_modules/execSync
> node install.js
[execsync v1.0.2] Attempting to compile native extensions.
[execSync v1.0.2]
Native code compile failed!!
npm WARN deprecated tough-cookie#2.2.2: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
npm WARN deprecated minimatch#0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch#2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
> node-zopfli#2.0.1 install /home/user/.npm-packages/lib/node_modules/angular-cli/node_modules/compression-webpack-plugin/node_modules/node-zopfli
> node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! Tried to download(403): https://node-zopfli.s3.amazonaws.com/Release/zopfli-v2.0.1-node-v46-linux-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for node-zopfli#2.0.1 and node#4.6.1 (node-v46 ABI) (falling back to source compile with node-gyp)
make: Entering directory '/home/user/.npm-packages/lib/node_modules/angular-cli/node_modules/compression-webpack-plugin/node_modules/node-zopfli/build'
CXX(target) Release/obj.target/zopfli/src/zopfli-binding.o
CXX(target) Release/obj.target/zopfli/src/png/zopflipng.o
CC(target) Release/obj.target/zopfli/zopfli/src/zopfli/blocksplitter.o
CC(target) Release/obj.target/zopfli/zopfli/src/zopfli/cache.o
CC(target) Release/obj.target/zopfli/zopfli/src/zopfli/deflate.o
CC(target) Release/obj.target/zopfli/zopfli/src/zopfli/gzip_container.o
CC(target) Release/obj.target/zopfli/zopfli/src/zopfli/hash.o
CC(target) Release/obj.target/zopfli/zopfli/src/zopfli/katajainen.o
CC(target) Release/obj.target/zopfli/zopfli/src/zopfli/lz77.o
In file included from ../zopfli/src/zopfli/lz77.c:21:0:
../zopfli/src/zopfli/symbols.h:38:12: warning: ‘ZopfliGetDistExtraBits’ defined but not used [-Wunused-function]
static int ZopfliGetDistExtraBits(int dist) {
^
../zopfli/src/zopfli/symbols.h:61:12: warning: ‘ZopfliGetDistExtraBitsValue’ defined but not used [-Wunused-function]
static int ZopfliGetDistExtraBitsValue(int dist) {
^
../zopfli/src/zopfli/symbols.h:138:12: warning: ‘ZopfliGetLengthExtraBits’ defined but not used [-Wunused-function]
static int ZopfliGetLengthExtraBits(int l) {
^
../zopfli/src/zopfli/symbols.h:161:12: warning: ‘ZopfliGetLengthExtraBitsValue’ defined but not used [-Wunused-function]
static int ZopfliGetLengthExtraBitsValue(int l) {
^
../zopfli/src/zopfli/symbols.h:222:12: warning: ‘ZopfliGetLengthSymbolExtraBits’ defined but not used [-Wunused-function]
static int ZopfliGetLengthSymbolExtraBits(int s) {
^
../zopfli/src/zopfli/symbols.h:231:12: warning: ‘ZopfliGetDistSymbolExtraBits’ defined but not used [-Wunused-function]
static int ZopfliGetDistSymbolExtraBits(int s) {
^
CC(target) Release/obj.target/zopfli/zopfli/src/zopfli/squeeze.o
In file included from ../zopfli/src/zopfli/squeeze.c:28:0:
../zopfli/src/zopfli/symbols.h:61:12: warning: ‘ZopfliGetDistExtraBitsValue’ defined but not used [-Wunused-function]
static int ZopfliGetDistExtraBitsValue(int dist) {
^
../zopfli/src/zopfli/symbols.h:161:12: warning: ‘ZopfliGetLengthExtraBitsValue’ defined but not used [-Wunused-function]
static int ZopfliGetLengthExtraBitsValue(int l) {
^
../zopfli/src/zopfli/symbols.h:222:12: warning: ‘ZopfliGetLengthSymbolExtraBits’ defined but not used [-Wunused-function]
static int ZopfliGetLengthSymbolExtraBits(int s) {
^
../zopfli/src/zopfli/symbols.h:231:12: warning: ‘ZopfliGetDistSymbolExtraBits’ defined but not used [-Wunused-function]
static int ZopfliGetDistSymbolExtraBits(int s) {
^
CC(target) Release/obj.target/zopfli/zopfli/src/zopfli/tree.o
CC(target) Release/obj.target/zopfli/zopfli/src/zopfli/util.o
CC(target) Release/obj.target/zopfli/zopfli/src/zopfli/zlib_container.o
CC(target) Release/obj.target/zopfli/zopfli/src/zopfli/zopfli_lib.o
CXX(target) Release/obj.target/zopfli/zopfli/src/zopflipng/zopflipng_lib.o
CXX(target) Release/obj.target/zopfli/zopfli/src/zopflipng/lodepng/lodepng.o
CXX(target) Release/obj.target/zopfli/zopfli/src/zopflipng/lodepng/lodepng_util.o
SOLINK_MODULE(target) Release/obj.target/zopfli.node
COPY Release/zopfli.node
COPY /home/user/.npm-packages/lib/node_modules/angular-cli/node_modules/compression-webpack-plugin/node_modules/node-zopfli/lib/binding/node-v46-linux-x64/zopfli.node
TOUCH Release/obj.target/action_after_build.stamp
make: Leaving directory '/home/user/.npm-packages/lib/node_modules/angular-cli/node_modules/compression-webpack-plugin/node_modules/node-zopfli/build'
npm WARN optional dep failed, continuing fsevents#1.0.15
npm WARN deprecated lodash-node#2.4.1: This package is discontinued. Use lodash#^4.0.0.
|
> node-sass#3.11.2 install /home/user/.npm-packages/lib/node_modules/angular-cli/node_modules/node-sass
> node scripts/install.js
Start downloading binary at https://github.com/sass/node-sass/releases/download/v3.11.2/linux-x64-46_binding.node
Binary downloaded and installed at /home/user/.npm-packages/lib/node_modules/angular-cli/node_modules/node-sass/vendor/linux-x64-46/binding.node
> node-sass#3.11.2 postinstall /home/user/.npm-packages/lib/node_modules/angular-cli/node_modules/node-sass
> node scripts/build.js
"/home/user/.npm-packages/lib/node_modules/angular-cli/node_modules/node-sass/vendor/linux-x64-46/binding.node" exists.
testing binary.
Binary is fine; exiting.
/home/user/.npm-packages/bin/ng -> /home/user/.npm-packages/lib/node_modules/angular-cli/bin/ng
angular-cli#1.0.0-beta.19-3 /home/user/.npm-packages/lib/node_modules/angular-cli
├── ember-cli-string-utils#1.0.0
├── json-loader#0.5.4
├── raw-loader#0.5.1
├── expose-loader#0.7.1
├── script-loader#0.7.0
├── symlink-or-copy#1.1.6
├── fs.realpath#1.0.0
├── rimraf#2.5.4
├── #angular-cli/base-href-webpack#1.0.6
├── denodeify#1.2.1
├── exit#0.1.2
├── karma-sourcemap-loader#0.3.7 (graceful-fs#4.1.10)
├── #ngtools/webpack#1.1.4
├── parse5#2.2.3
├── chalk#1.1.3 (escape-string-regexp#1.0.5, ansi-styles#2.2.1, supports-color#2.0.0, strip-ansi#3.0.1, has-ansi#2.0.0)
├── file-loader#0.8.5 (loader-utils#0.2.16)
├── url-loader#0.5.7 (mime#1.2.11, loader-utils#0.2.16)
├── opn#4.0.1 (object-assign#4.1.0, pinkie-promise#2.0.1)
├── style-loader#0.13.1 (loader-utils#0.2.16)
├── sass-loader#3.2.3 (object-assign#4.1.0, async#1.5.2, loader-utils#0.2.16)
├── silent-error#1.0.1 (debug#2.2.0)
├── zone.js#0.6.26
├── #angular/platform-server#2.1.2
├── fs-extra#0.30.0 (path-is-absolute#1.0.1, klaw#1.3.1, graceful-fs#4.1.10, jsonfile#2.4.0)
├── glob#7.1.1 (path-is-absolute#1.0.1, inherits#2.0.3, inflight#1.0.6, once#1.4.0, minimatch#3.0.3)
├── ts-loader#0.8.2 (object-assign#2.1.1, arrify#1.0.1, semver#5.3.0, colors#1.1.2, loader-utils#0.2.16, enhanced-resolve#0.9.1)
├── tslint-loader#2.1.5 (object-assign#4.1.0, strip-json-comments#1.0.4, loader-utils#0.2.16, mkdirp#0.5.1)
├── stylus-loader#2.3.1 (loader-utils#0.2.16, when#3.6.4)
├── shelljs#0.7.5 (interpret#1.0.1, rechoir#0.6.2)
├── less-loader#2.2.3 (loader-utils#0.2.16)
├── webpack-merge#0.14.1 (lodash.isequal#4.4.0, lodash.merge#3.3.2, lodash.isplainobject#3.2.0, lodash.find#3.2.1)
├── resolve#1.1.7
├── source-map-loader#0.1.5 (async#0.9.2, loader-utils#0.2.16, source-map#0.1.43)
├── exports-loader#0.6.3 (loader-utils#0.2.16, source-map#0.1.43)
├── webpack-md5-hash#0.0.5 (md5#2.2.1)
├── offline-plugin#3.4.2 (deep-extend#0.4.1, loader-utils#0.2.16, es6-promise#3.3.1, minimatch#3.0.3, ejs#2.5.2)
├── enhanced-resolve#2.3.0 (object-assign#4.1.0, graceful-fs#4.1.10, tapable#0.2.4, memory-fs#0.3.0)
├── postcss-loader#0.9.1 (loader-utils#0.2.16, postcss#5.2.5)
├── #angular/compiler-cli#2.1.2 (minimist#1.2.0, reflect-metadata#0.1.8)
├── npm-run-all#3.1.1 (object-assign#4.1.0, pinkie-promise#2.0.1, read-pkg-up#1.0.1, shell-quote#1.6.1, minimatch#3.0.3, cross-spawn#4.0.2, ps-tree#1.1.0, read-pkg#1.1.0, string.prototype.padend#3.0.0)
├── #angular/common#2.1.2
├── #angular/platform-browser#2.1.2
├── leek#0.0.21 (debug#2.2.0, lodash.assign#3.2.0, rsvp#3.3.3, request#2.78.0)
├── sourcemap-istanbul-instrumenter-loader#0.2.0 (object-assign#4.1.0, loader-utils#0.2.16, istanbul#0.4.5)
├── istanbul-instrumenter-loader#0.2.0 (object-assign#4.1.0, loader-utils#0.2.16, istanbul#0.4.5)
├── webpack-dev-server#2.1.0-beta.9 (connect-history-api-fallback#1.3.0, strip-ansi#3.0.1, supports-color#3.1.2, opn#4.0.2, compression#1.6.2, express#4.14.0, webpack-dev-middleware#1.8.4, spdy#3.4.4, http-proxy-middleware#0.17.2, chokidar#1.6.1, sockjs#0.3.18, serve-index#1.8.0, sockjs-client#1.1.1, yargs#4.8.1)
├── angular2-template-loader#0.5.0 (loader-utils#0.2.16, codecov#1.0.1)
├── stylus#0.54.5 (css-parse#1.7.0, debug#2.2.0, mkdirp#0.5.1, glob#7.0.6, source-map#0.1.43, sax#0.5.8)
├── html-webpack-plugin#2.24.1 (toposort#1.0.0, loader-utils#0.2.16, bluebird#3.4.6, html-minifier#3.1.0, pretty-error#2.0.2)
├── handlebars#4.0.5 (async#1.5.2, source-map#0.4.4, optimist#0.6.1, uglify-js#2.7.4)
├── typescript#2.0.7
├── common-tags#1.3.1 (babel-runtime#6.18.0)
├── awesome-typescript-loader#2.2.4 (object-assign#4.1.0, colors#1.1.2, loader-utils#0.2.16, source-map-support#0.4.6)
├── remap-istanbul#0.6.4 (amdefine#1.0.0, source-map#0.5.6, through2#2.0.1, gulp-util#3.0.7, istanbul#0.4.3)
├── #angular/tsc-wrapped#0.3.0 (tsickle#0.1.7)
├── compression-webpack-plugin#0.3.2 (async#0.2.10, webpack-sources#0.1.2, node-zopfli#2.0.1)
├── tslint#3.15.1 (colors#1.1.2, diff#2.2.3, optimist#0.6.1, findup-sync#0.3.0, underscore.string#3.3.4)
├── #angular/core#2.1.2
├── #angular/compiler#2.1.2
├── string-replace-loader#1.0.5 (loader-utils#0.2.16, lodash#3.10.1)
├── webpack#2.1.0-beta.25 (object-assign#4.1.0, interpret#1.0.1, tapable#0.2.4, async#1.5.2, clone#1.0.2, supports-color#3.1.2, loader-utils#0.2.16, loader-runner#2.2.0, source-map#0.5.6, mkdirp#0.5.1, acorn#3.3.0, memory-fs#0.3.0, webpack-sources#0.1.2, uglify-js#2.7.4, watchpack#1.1.0, ajv#4.8.2, yargs#4.8.1, node-libs-browser#1.0.0)
├── karma-webpack#1.8.0 (async#0.9.2, loader-utils#0.2.16, source-map#0.1.43, webpack-dev-middleware#1.8.4, lodash#3.10.1)
├── protractor#3.3.0 (jasminewd2#0.0.9, q#1.4.1, adm-zip#0.4.7, source-map-support#0.4.6, glob#6.0.4, optimist#0.6.1, saucelabs#1.0.1, jasmine#2.4.1, request#2.67.0, selenium-webdriver#2.52.0)
├── typedoc#0.4.5 (progress#1.1.8, marked#0.3.6, minimatch#3.0.3, typedoc-default-themes#0.4.0, typescript#1.8.10, highlight.js#9.8.0)
├── css-loader#0.23.1 (postcss-modules-extract-imports#1.0.1, object-assign#4.1.0, loader-utils#0.2.16, postcss-modules-values#1.2.2, css-selector-tokenizer#0.5.4, source-list-map#0.1.6, lodash.camelcase#3.0.1, postcss-modules-scope#1.0.2, postcss-modules-local-by-default#1.1.1, postcss#5.2.5, cssnano#3.8.0)
├── less#2.7.1 (graceful-fs#4.1.10, mime#1.3.4, image-size#0.5.0, source-map#0.5.6, errno#0.1.4, mkdirp#0.5.1, promise#7.1.1)
├── lodash#4.16.6
├── core-js#2.4.1
├── rxjs#5.0.0-beta.12 (symbol-observable#1.0.4)
├── #angular-cli/ast-tools#1.0.7 (rxjs#5.0.0-beta.11)
├── node-sass#3.11.2 (get-stdin#4.0.1, lodash.assign#4.2.0, lodash.clonedeep#4.5.0, async-foreach#0.1.3, in-publish#2.0.0, nan#2.4.0, mkdirp#0.5.1, cross-spawn#3.0.1, gaze#1.1.2, npmlog#4.0.0, meow#3.7.0, request#2.78.0, sass-graph#2.1.2, node-gyp#3.4.0)
└── ember-cli#2.5.0 (ember-cli-test-info#1.0.0, ember-cli-path-utils#1.0.0, ember-cli-is-package-missing#1.0.0, clean-base-url#1.0.0, ember-cli-normalize-entity-name#1.0.0, get-caller-file#1.0.2, fs-monitor-stack#1.1.1, git-repo-info#1.3.1, broccoli-funnel-reducer#1.0.0, ember-cli-valid-component-name#1.0.0, ember-cli-get-component-path-option#1.0.0, is-git-url#0.2.3, escape-string-regexp#1.0.5, promise-map-series#0.2.3, isbinaryfile#2.0.4, broccoli-plugin#1.2.2, broccoli-source#1.1.0, exists-sync#0.0.3, semver#5.3.0, filesize#3.3.0, inflection#1.10.0, bower-endpoint-parser#0.2.2, broccoli-viz#2.0.1, node-modules-path#1.0.1, through#2.3.8, amd-name-resolver#0.0.5, broccoli-sane-watcher#1.1.5, walk-sync#0.2.7, node-uuid#1.4.7, portfinder#1.0.9, nopt#3.0.6, debug#2.2.0, http-proxy#1.15.2, minimatch#3.0.3, readline2#0.1.1, diff#2.2.3, temp#0.8.3, findup#0.1.5, morgan#1.7.0, glob#7.0.3, configstore#2.1.0, fs-tree-diff#0.4.4, broccoli-funnel#1.0.9, rsvp#3.3.3, merge-defaults#0.2.1, ora#0.2.3, mkdirp#0.5.1, broccoli-kitchen-sink-helpers#0.3.1, quick-temp#0.1.5, fs-extra#0.26.7, compression#1.6.2, sane#1.4.1, findup-sync#0.2.1, express#4.14.0, broccoli-config-replace#1.1.2, inquirer#0.12.0, cpr#0.4.2, tree-sync#1.1.4, broccoli-merge-trees#1.1.4, yam#0.0.18, ember-router-generator#1.2.2, ember-cli-broccoli#0.16.9, broccoli-config-loader#1.0.0, tiny-lr#0.2.1, broccoli-concat#2.3.8, markdown-it#4.3.0, markdown-it-terminal#0.0.3, testem#1.13.0, ember-cli-preprocess-registry#2.0.0, core-object#0.0.2, bower-config#1.4.0, broccoli-babel-transpiler#5.6.1, bower#1.7.9, npm#2.14.21)
Trying to debug it, I tried the minimatch installaton by running sudo npm install -g minimatch#3.0.2, which gives me this output.
minimatch#3.0.2 /home/user/.npm-packages/lib/node_modules/minimatch
└── brace-expansion#1.1.6 (balanced-match#0.4.2, concat-map#0.0.1)
But when I do npm minimatch -v it gives me this 2.15.9
Any suggestions?
It should be npm install #angular/cli -g not angular/cli. I also recommended not using '#latest'. Uninstall all with: npm uninstall angular/cli then run npm install -g #angular/cli. Should work for you.

Issue running Ionic commands in PowerShell

When I try to run an ionic command in PowerShell I get an error that says
ionic : The term 'ionic' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ ionic
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (ionic:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Does anyone know how I can fix this? Do I need to add a path variable to my environment variables?
I have installed node.js successfully and I believe have successfully installed Ionic and Cordova as well with the command "npm install -g ionic cordova"
The output from the "npm install -g ionic" is below
C:\Users\username\AppData\Roaming\npm\ionic -> C:\Users\username\AppData\Roaming\npm\node_modules\ionic\bin\ionic
ionic#1.3.20 C:\Users\username\AppData\Roaming\npm\node_modules\ionic
├── proxy-middleware#0.7.0
├── connect-livereload#0.5.2
├── progress#1.1.7
├── open#0.0.5
├── colors#0.6.2
├── ncp#0.4.2
├── underscore#1.7.0
├── crc#3.2.1
├── async#0.9.0
├── q#1.0.1
├── semver#4.3.1
├── shelljs#0.2.6
├── cross-spawn#0.2.3 (lru-cache#2.5.0)
├── cli-table#0.3.1 (colors#1.0.3)
├── event-stream#3.0.20 (stream-combiner#0.0.4, duplexer#0.1.1, from#0.1.3, map-stream#0.0.5, pause-stream#0.0.11, split
#0.2.10, through#2.3.6)
├── finalhandler#0.2.0 (escape-html#1.0.1, debug#2.0.0)
├── form-data#0.1.4 (mime#1.2.11, combined-stream#0.0.7)
├── optimist#0.6.0 (wordwrap#0.0.2, minimist#0.0.10)
├── connect#3.1.1 (utils-merge#1.0.0, parseurl#1.3.0, debug#1.0.4, finalhandler#0.1.0)
├── opbeat-ionic#1.1.3 (json-stringify-safe#5.0.0, console-log-level#1.0.0, stackman#0.2.2, after-all#2.0.1)
├── npm#2.1.3
├── tiny-lr-fork#0.0.5 (debug#0.7.4, qs#0.5.6, faye-websocket#0.4.4, noptify#0.0.3)
├── serve-static#1.7.1 (escape-html#1.0.1, utils-merge#1.0.0, parseurl#1.3.0, send#0.10.1)
├── xml2js#0.4.4 (sax#0.6.1, xmlbuilder#2.6.2)
├── unzip#0.1.9 (setimmediate#1.0.2, readable-stream#1.0.33, pullstream#0.4.1, match-stream#0.0.2, binary#0.3.0, fstream
#0.1.31)
├── prompt#0.2.12 (revalidator#0.1.8, pkginfo#0.3.0, read#1.0.5, winston#0.6.2, utile#0.2.1)
├── request#2.51.0 (json-stringify-safe#5.0.0, caseless#0.8.0, forever-agent#0.5.2, aws-sign2#0.5.0, stringstream#0.0.4,
tunnel-agent#0.4.0, oauth-sign#0.5.0, node-uuid#1.4.3, qs#2.3.3, mime-types#1.0.2, combined-stream#0.0.7, tough-cookie#
0.12.1, bl#0.9.4, http-signature#0.10.1, form-data#0.2.0, hawk#1.1.1)
├── vinyl-fs#0.3.7 (graceful-fs#3.0.6, lodash#2.4.1, strip-bom#1.0.0, vinyl#0.4.6, mkdirp#0.5.0, through2#0.6.3, glob-st
ream#3.1.18, glob-watcher#0.0.6)
├── archiver#0.5.1 (lodash#2.4.1, readable-stream#1.1.13, lazystream#0.1.0, zip-stream#0.1.4, file-utils#0.1.5)
└── gulp#3.8.8 (pretty-hrtime#0.2.2, interpret#0.3.10, deprecated#0.0.1, archy#0.0.2, minimist#1.1.1, semver#3.0.1, tild
ify#1.0.0, chalk#0.5.1, orchestrator#0.3.7, gulp-util#3.0.4, liftoff#0.12.1)
I figured out my mistake. I was missing a path variable to system32. Thanks for the help!

How does npm draw the dependency tree?

npm does a nifty job of drawing a package's dependency hierarchy as a tree in the console:
$ npm ls
my-awesome-project#0.0.1
├── colors#0.6.0-1
├─┬ express#2.5.11
│ ├─┬ connect#1.9.2
│ │ └── formidable#1.0.11
│ ├── mime#1.2.4
│ ├── mkdirp#0.3.0
│ └── qs#0.4.2
└── uglify-js#1.2.6
How does npm do this?
npm uses the Unicode box drawing characters (U+2500-2800) to draw the pretty lines of the tree.
To draw a similar tree in your own application, the best route is probably to use the same module that npm itself uses – archy.
var archy = require('archy');
var s = archy({
label : 'beep',
nodes : [
'ity',
{
label : 'boop',
nodes : [
{
label : 'o_O',
nodes : [
{
label : 'oh',
nodes : [ 'hello', 'puny' ]
},
'human'
]
},
'party\ntime!'
]
}
]
});
console.log(s);
Outputs
beep
├── ity
└─┬ boop
├─┬ o_O
│ ├─┬ oh
│ │ ├── hello
│ │ └── puny
│ └── human
└── party
time!
For list your folders and files you can use tree-cli:
https://www.npmjs.com/package/tree-cli
Just install:
npm install -g tree-cli
And use inside your folder:
tree -L 2, -d
You could also use console2 which does almost the same thing as archy does, but gives you useful additional features like improved stack traces, object inspection and more:
Feature screenshot
Full disclosure: I'm the author of the repository

NodeJS: Express 3.0 with connect-flash( as advised in the passport local strategy), still finding exception for req.flash

I'm new to NodeJS and trying to build an app over Express3.0, included passport local strategy for authentication purpose. But the following exception(with respect to req.flash) blocks my progress.
Exception occurs in the following line.
res.render('login', { user: req.user, message: req.flash('error') });
Express
500 TypeError: Object # has no method 'flash'
at /Users/vivekanandan/Source/Git/ExpressApp/CosmicEnergyCoupled/app.js:115:54
at callbacks (/Users/vivekanandan/Source/Git/ExpressApp/CosmicEnergyCoupled/node_modules/express/lib/router/index.js:162:37)
at param (/Users/vivekanandan/Source/Git/ExpressApp/CosmicEnergyCoupled/node_modules/express/lib/router/index.js:136:11)
at pass (/Users/vivekanandan/Source/Git/ExpressApp/CosmicEnergyCoupled/node_modules/express/lib/router/index.js:143:5)
at Router._dispatch (/Users/vivekanandan/Source/Git/ExpressApp/CosmicEnergyCoupled/node_modules/express/lib/router/index.js:171:5)
at Object.router (/Users/vivekanandan/Source/Git/ExpressApp/CosmicEnergyCoupled/node_modules/express/lib/router/index.js:33:10)
at next (/Users/vivekanandan/Source/Git/ExpressApp/CosmicEnergyCoupled/node_modules/express/node_modules/connect/lib/proto.js:190:15)
at store.get.next (/Users/vivekanandan/Source/Git/ExpressApp/CosmicEnergyCoupled/node_modules/express/node_modules/connect/lib/middleware/session.js:310:9)
at /Users/vivekanandan/Source/Git/ExpressApp/CosmicEnergyCoupled/node_modules/express/node_modules/connect/lib/middleware/session.js:333:9
at /Users/vivekanandan/Source/Git/ExpressApp/CosmicEnergyCoupled/node_modules/express/node_modules/connect/lib/middleware/session/memory.js:52:9
I have installed connect-flash to recover the deprecated req.flash method as advised by the author(passport-local-strategy). Please find the npm packages installed in the app.
├── connect-flash#0.1.0
├── ejs#0.8.3
├── ejs-locals#0.2.5
├─┬ express#3.0.0
│ ├── commander#0.6.1
│ ├─┬ connect#2.6.0
│ │ ├── bytes#0.1.0
│ │ ├── formidable#1.0.11
│ │ ├── pause#0.0.1
│ │ ├── qs#0.5.1
│ │ └─┬ send#0.0.4
│ │ └── mime#1.2.6
│ ├── cookie#0.0.4
│ ├── crc#0.2.0
│ ├── debug#0.7.0
│ ├── fresh#0.1.0
│ ├── methods#0.0.1
│ ├── mkdirp#0.3.3
│ ├── range-parser#0.0.4
│ └─┬ send#0.1.0
│ └── mime#1.2.6
├─┬ passport#0.1.12
│ └── pkginfo#0.2.3
├─┬ passport-local#0.1.6
│ ├── passport#0.1.12
│ └── pkginfo#0.2.3
├─┬ socket.io#0.9.10
│ ├── policyfile#0.0.4
│ ├── redis#0.7.2
│ └─┬ socket.io-client#0.9.10
│ ├─┬ active-x-obfuscator#0.0.1
│ │ └── zeparser#0.0.5
│ ├── uglify-js#1.2.5
│ ├─┬ ws#0.4.22
│ │ ├── commander#0.6.1
│ │ ├── options#0.0.3
│ │ └── tinycolor#0.0.1
│ └── xmlhttprequest#1.4.2
└─┬ stylus#0.30.1
├── cssom#0.2.5
├── debug#0.7.0
└── mkdirp#0.3.4
Try adding this to your main app.configure method
app.use(flash());
npm install connect-flash --save
var flash = require('connect-flash')
app.use(flash());
You're using it wrong I think. You just have to call req.flash() with type and message before res.redirect
req.flash('info', 'Welcome to the site, a welcome email has been sent to you.');
res.redirect('/');

How to write a package.json file so that all dependencies are downloaded with "npm install"

I wrote a simple application using node. It depends on express, mongodb and mongoose (easy).
So, I created a file called package.json and put this in it:
{
"name": "booking-dojo",
"description": "Booking dojo app",
"version": "0.0.1",
"private": true,
"dependencies": {
"express": "3.x",
"mongodb": "*",
"mongoose": "*"
}
}
I then ran npm install, expecting npm to install those modules and their dependencies.
The result was disappointing:
booking-dojo#0.0.1 /home/merc/Synced/Development/Bookings/app/server
├─┬ express#3.0.0rc3
│ ├── commander#0.6.1
│ ├─┬ connect#2.4.3
│ │ ├── bytes#0.1.0
│ │ ├── formidable#1.0.11
│ │ ├── pause#0.0.1
│ │ └── qs#0.4.2
│ ├── cookie#0.0.4
│ ├── crc#0.2.0
│ ├── debug#0.7.0
│ ├── fresh#0.1.0
│ ├── methods#0.0.1
│ ├── mkdirp#0.3.3
│ ├── range-parser#0.0.4
│ └─┬ send#0.0.3
│ └── mime#1.2.6
├─┬ mongodb#1.1.4
│ └── bson#0.1.1
└─┬ mongoose#3.0.3
├── hooks#0.2.1
└── ms#0.1.0
I am confused by this, as I know that express needs jade (and much more), and mongoose needs mongodb.
If I go into node_modules/jade and run npm install, the result from the main tree is very different:
booking-dojo#0.0.1 /home/merc/Synced/Development/Bookings/app/server
├─┬ express#3.0.0rc3
│ ├── commander#0.6.1
│ ├─┬ connect#2.4.3
│ │ ├── bytes#0.1.0
│ │ ├── formidable#1.0.11
│ │ ├── pause#0.0.1
│ │ └── qs#0.4.2
│ ├─┬ connect-redis#1.4.1
│ │ └─┬ redis#0.7.2
│ │ └── hiredis#0.1.14
│ ├── cookie#0.0.4
│ ├── crc#0.2.0
│ ├── debug#0.7.0
│ ├── ejs#0.8.2
│ ├── fresh#0.1.0
│ ├── github-flavored-markdown#1.0.1
│ ├─┬ hjs#0.0.4
│ │ └── hogan.js#2.0.0
│ ├─┬ jade#0.27.2
│ │ └── mkdirp#0.3.0
│ ├── methods#0.0.1
│ ├── mkdirp#0.3.3
│ ├─┬ mocha#1.4.0
│ │ ├── diff#1.0.2
│ │ ├── growl#1.5.1
│ │ └─┬ jade#0.26.3
│ │ └── mkdirp#0.3.0
│ ├── range-parser#0.0.4
│ ├─┬ send#0.0.3
│ │ └── mime#1.2.6
│ ├── should#1.1.0
│ ├─┬ stylus#0.29.0
│ │ └── cssom#0.2.5
│ └─┬ supertest#0.0.1
│ └─┬ superagent#0.5.0
│ ├── emitter-component#0.0.1
│ ├── formidable#1.0.9
│ ├── mime#1.2.5
│ └── qs#0.4.2
├─┬ mongodb#1.1.4
│ └── bson#0.1.1
└─┬ mongoose#3.0.3
├── hooks#0.2.1
└── ms#0.1.0
So, express has grown a lot. It looks like npm install is only loading some of the dependencies of the sub-modules.
Can somebody please shed some light on this? Why are some dependencies missing? Am I doing something wrong? (likely)
Thanks!
Merc.
You are confused about at least 2 points.
First, express does not depend on jade, as you can see by reading the node_modules/express/package.json file:
"dependencies": {
"connect": "2.4.2",
"commander": "0.6.1",
"range-parser": "0.0.4",
"mkdirp": "0.3.3",
"cookie": "0.0.4",
"crc": "0.2.0",
"fresh": "0.1.0",
"methods": "0.0.1",
"send": "0.0.3",
"debug": "*"
}
Express does, however, work with jade if it is available, as well as many other template engines. So to fix this list jade as a dependency in your package.json file and you'll be fine.
Second, npm only installs node packages, not third party things like mongodb. You need to install mongodb and any other dependencies that are not npm modules using other means (apt-get, yum, manual install, etc).
So npm DOES install dependencies recursively, but only npm modules.
The answer was provided by Brandon in a comment to another answer:
"Another thing to note is that if a package depends on a module that can be resolved further up in the dependency chain, it will. For example, since you have mongodb in your package.json, Mongoose doesn't need to install its own mongodb. – Brandon Tilley 2 days ago
Thank you Brandon! (And this is the answer...)
use this sample
{
"name": "app",
"version": "0.0.1",
"main":"test.js",
"author":"Test",
"description": "For test ",
"dependencies": {
"express": "latest",
"mongoose": "latest"
}
}

Resources