yoeman/ubuntu: not recognized yo command - node.js

I am trying to install yoeman in ubuntu (via terminal) and I can't execute the command yo because it is not found. These are the steps I am using:
dmr#xxxxxxxxxxx:/home$ sudo npm install yo -g
npm WARN deprecated npmconf#2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
-
> spawn-sync#1.0.15 postinstall /home/xxxxxxxxxxx/.npm/lib/node_modules/yo/node_modules/yeoman-environment/node_modules/inquirer/node_modules/external-editor/node_modules/spawn-sync
> node postinstall
> spawn-sync#1.0.15 postinstall /home/xxxxxxxxxxx/.npm/lib/node_modules/yo/node_modules/tabtab/node_modules/inquirer/node_modules/external-editor/node_modules/spawn-sync
> node postinstall
/home/xxxxxxxxxxx/.npm/bin/yo -> /home/xxxxxxxxxxx/.npm/lib/node_modules/yo/lib/cli.js
/home/xxxxxxxxxxx/.npm/bin/yo-complete -> /home/xxxxxxxxxxx/.npm/lib/node_modules/yo/lib/completion/index.js
> yo#1.8.4 postinstall /home/xxxxxxxxxxx/.npm/lib/node_modules/yo
> yodoctor
Yeoman Doctor
Running sanity checks on your system
✔ Global configuration file is valid
✔ NODE_PATH matches the npm root
✔ Node.js version
✔ No .bowerrc file in home directory
✔ No .yo-rc.json file in home directory
✖ npm version
Your npm version is outdated.
Upgrade to the latest version by running:
npm install -g npm
Found potential issues on your machine :(
yo#1.8.4 /home/xxxxxxxxxxx/.npm/lib/node_modules/yo
├── cli-list#0.1.8
├── titleize#1.0.0
├── async#1.5.2
├── humanize-string#1.0.1 (decamelize#1.2.0)
├── opn#3.0.3 (object-assign#4.1.0)
├── user-home#2.0.0 (os-homedir#1.0.1)
├── figures#1.7.0 (escape-string-regexp#1.0.5, object-assign#4.1.0)
├── string-length#1.0.1 (strip-ansi#3.0.1)
├── chalk#1.1.3 (escape-string-regexp#1.0.5, ansi-styles#2.2.1, supports-color#2.0.0, has-ansi#2.0.0, strip-ansi#3.0.1)
├── repeating#2.0.1 (is-finite#1.0.1)
├── sort-on#1.3.0 (arrify#1.0.1, dot-prop#2.4.0)
├── root-check#1.0.0 (sudo-block#1.2.0, downgrade-root#1.2.2)
├── yeoman-character#1.1.0 (supports-color#3.1.2)
├── parse-help#0.1.1 (execall#1.0.0)
├── cross-spawn#3.0.1 (lru-cache#4.0.1, which#1.2.10)
├── yosay#1.2.0 (ansi-regex#2.0.0, strip-ansi#3.0.1, ansi-styles#2.2.1, wrap-ansi#2.0.0, cli-boxes#1.0.0, pad-component#0.0.1, string-width#1.0.2, taketalk#1.0.0)
├── package-json#2.3.3 (registry-url#3.1.0, semver#5.3.0, rc#1.1.6)
├── got#5.6.0 (lowercase-keys#1.0.0, timed-out#2.0.0, is-redirect#1.0.0, is-plain-obj#1.1.0, is-stream#1.1.0, node-status-codes#1.0.0, duplexer2#0.1.4, is-retry-allowed#1.1.0, read-all-stream#3.1.0, unzip-response#1.0.0, object-assign#4.1.0, pinkie-promise#2.0.1, url-parse-lax#1.0.0, create-error-class#3.0.2, readable-stream#2.1.5, parse-json#2.2.0)
├── configstore#1.4.0 (object-assign#4.1.0, os-tmpdir#1.0.1, graceful-fs#4.1.6, xdg-basedir#2.0.0, uuid#2.0.2, osenv#0.1.3, write-file-atomic#1.2.0, mkdirp#0.5.1)
├── inquirer#0.11.4 (strip-ansi#3.0.1, ansi-regex#2.0.0, ansi-escapes#1.4.0, rx-lite#3.1.2, through#2.3.8, cli-width#1.1.1, string-width#1.0.2, readline2#1.0.1, cli-cursor#1.0.2, run-async#0.1.0)
├── npm-keyword#4.2.0 (object-assign#4.1.0, pinkie-promise#2.0.1, registry-url#3.1.0)
├── update-notifier#0.6.3 (is-npm#1.0.0, latest-version#2.0.0, semver-diff#2.1.0, boxen#0.3.1, configstore#2.0.0)
├── meow#3.7.0 (map-obj#1.0.1, trim-newlines#1.0.0, decamelize#1.2.0, object-assign#4.1.0, camelcase-keys#2.1.0, minimist#1.2.0, redent#1.0.0, loud-rejection#1.6.0, normalize-package-data#2.3.5)
├── fullname#2.1.0 (pify#2.3.0, pinkie-promise#2.0.1, npmconf#2.1.2)
├── read-pkg-up#1.0.1 (find-up#1.1.2, read-pkg#1.1.0)
├── yeoman-doctor#2.1.0 (object-values#1.0.0, log-symbols#1.0.2, semver#5.3.0, each-async#1.1.1, bin-version-check#2.1.0, twig#0.8.9)
├── insight#0.7.0 (object-assign#4.1.0, tough-cookie#2.3.1, lodash.debounce#3.1.1, os-name#1.0.3, inquirer#0.10.1, request#2.74.0)
├── lodash#3.10.1
├── yeoman-environment#1.6.3 (log-symbols#1.0.2, escape-string-regexp#1.0.5, text-table#0.2.0, untildify#2.1.0, debug#2.2.0, diff#2.2.3, globby#4.1.0, mem-fs#1.1.3, grouped-queue#0.3.2, inquirer#1.1.2, lodash#4.15.0)
└── tabtab#1.3.2 (object-assign#4.1.0, minimist#1.2.0, debug#2.2.0, mkdirp#0.5.1, npmlog#2.0.4, inquirer#1.1.2)
I execute yo and command is not recognized.
Reading the result I see npm version is not installed to the latest version. I execute then:
sudo npm install -g npm
xxxxxx#xxxxxxxxxx:/home$ sudo npm install -g npm
/home/xxxxxx/npm/bin/npm -> /home/xxxxx/.npm/lib/node_modules/npm/bin/npm-cli.js
npm#3.10.6 /home/xxxxxx/.npm/lib/node_modules/npm
and get current version is:
xxxxxxxx:/home$ npm -v
2.15.9
I dont know if it really is the latest version of npm.
What is happening? What is wrong in the commands of linux?

I found the solution...
I am new in ubuntu and today when I turn on the ubuntu had packages corrupted... specially start stoped in npm package.
I reinstalled ubuntu and now I could install last version of npm 3.10.6 and after it yo (yeoman for angular)
I dont know if after this situation I can repare packages bad installed

Related

Update npm module, but showing different older version in my console window

I wanted to install the latest version of socket.io, and the latest ver seems to be 1.45.socket.io download
To do this, I just type the following command.
npm install socket.io
However, when I checked installed modules in my laptop, socket.io's version did not change as can be seen below.
YANAGISAWAYUMA-no-MacBook-Pro:~ yanagisawa_yuma$ npm list --depth=0
yanagisawa_yuma#0.0.0 /Users/yanagisawa_yuma
├── ar-drone#0.3.3 extraneous (git://github.com/felixge/node-ar-drone.git#228bd4573e765bed3861f259ce7e66fcace15f43)
├── express#4.9.0
├── gulp#3.9.0
├── node#0.0.0
├── node-osc#1.1.0 extraneous
├── node-static#0.7.3
├── socket.io#1.1.0
└── static#2.0.0
What am I missing?
Instead of simply npm install socket.io,
try npm install socket.io#version

Error during NPM install PM2 -g (Ubuntu 14.04 x64)

I am getting an error whilst trying to run npm install pm2 -g on a cloud Ubuntu 14.04 microserver/droplet.
I've tried:
sudo npm install pm2 -g
and
npm cache clear -f
...followed by both sudo and non-sudo installation attempts. All result in the below.
Verbatim outcome:
npm ERR! git clone --template=/root/.npm/_git-remotes/_templates --mirror http://ikt.pm2.io/ikt.git /root/.npm/_git-remotes/http-ikt-pm2-io-ikt-git-4d23bf0d: undefined
npm ERR! git clone --template=/root/.npm/_git-remotes/_templates --mirror http://ikt.pm2.io/ikt.git /root/.npm/_git-remotes/http-ikt-pm2-io-ikt-git-4d23bf0d: undefined
npm WARN optional dep failed, continuing ikt#git+http://ikt.pm2.io/ikt.git#master
npm WARN optional dep failed, continuing fsevents#0.3.8
/usr/local/bin/pm2 -> /usr/local/lib/node_modules/pm2/bin/pm2
/usr/local/bin/pm2-dev -> /usr/local/lib/node_modules/pm2/bin/pm2-dev
pm2#0.15.6 /usr/local/lib/node_modules/pm2
├── async#1.4.2
├── eventemitter2#0.4.14
├── isbinaryfile#2.0.4
├── semver#5.0.3
├── pidusage#0.1.1
├── safe-clone-deep#1.0.5
├── debug#2.2.0 (ms#0.7.1)
├── coffee-script#1.9.3
├── pm2-deploy#0.2.1 (tv4#1.0.18)
├── shelljs#0.5.3
├── commander#2.8.1 (graceful-readlink#1.0.1)
├── vizion#0.2.11 (async#0.9.0)
├── chalk#1.1.1 (escape-string-regexp#1.0.3, ansi-styles#2.1.0, supports-color#2.0.0, has-ansi#2.0.0, strip-ansi#3.0.0)
├── cli-table#0.3.1 (colors#1.0.3)
├── pm2-multimeter#0.1.2 (charm#0.1.2)
├── pm2-axon-rpc#0.3.6 (json-stringify-safe#5.0.1, commander#1.0.5)
├── mkdirp#0.5.1 (minimist#0.0.8)
├── nssocket#0.5.3 (lazy#1.0.11)
├── pm2-axon#2.0.8 (amp-message#0.1.2, escape-regexp#0.0.1, amp#0.3.1, configurable#0.0.1, debug#2.0.0)
├── cron#1.0.9 (moment-timezone#0.3.1)
├── blessed#0.1.61
├── pmx#0.5.3 (json-stringify-safe#5.0.1)
├── chokidar#1.0.6 (arrify#1.0.0, is-glob#1.1.3, path-is-absolute#1.0.0, async-each#0.1.6, is-binary-path#1.0.1, glob-parent#1.3.0, readdirp#1.4.0, anymatch#1.3.0)
└── moment#2.10.6
root#xxxx:~#
Is the Git repo b0rked? I'm quite new to SSH/Linux servers etc so this is all probably very obvious... :/
Figured it out: turned out it had installed ok.
The above was misleading as it a) looked as though it'd not completed properly, and b) trying to run any PM2-based command immediately afterwards was resulting in an error.
But it's now working.

Can't install Meteor Up / (mup)

After installing npm I typed:
npm install -g mup
It returned:
/Users/RyanCassutt/.node/bin/mup -> /Users/RyanCassutt/.node/lib/node_modules/mup/bin/mup
mup#0.11.1 /Users/RyanCassutt/.node/lib/node_modules/mup
├── colors#0.6.2
├── underscore#1.7.0
├── uuid#1.4.2
├── async#0.9.2
├── rimraf#2.4.2 (glob#5.0.14)
├── archiver#0.14.4 (buffer-crc32#0.2.5, lazystream#0.1.0, readable-stream#1.0.33, tar-stream#1.1.5, glob#4.3.5, zip-stream#0.5.2, lodash#3.2.0)
├── nodemiral#1.1.0 (debug#0.7.4, progress#1.1.5, async#0.9.0, underscore#1.8.3, ejs#0.8.8, ssh2#0.4.6)
└── cjson#0.3.1 (jsonlint#1.6.0)
I then try to create a new project:
mup init
But it returns:
-bash: mup: command not found
Is mup not installing correctly or is there some type of error? Thank you.

MEAN.io - install npm gives many errors

This problem is driving me absolutely insane...following all the instructions from mean.io (http://learn.mean.io/) I get to the part where i need to do npm install on my newly created project folder, and then I get loads of error messages:
E:\Users\Ben\Documents\web\MEAN\very Mean>npm install
npm WARN engine meanio#0.7.1: wanted: {"node":"0.10.x","npm":"1.4.x"} (current:
{"node":"0.12.1","npm":"2.5.1"})
> meanio#0.7.1 preinstall E:\Users\Ben\Documents\web\MEAN\very Mean\node_modules
\meanio
> node ./scripts/preinstall
npm WARN engine mean-cli#0.9.26: wanted: {"node":"0.10.x","npm":"2.1.x"} (current: {"node":"0.12.1","npm":"2.5.1"})
> mean-health#0.1.7 postinstall E:\Users\Ben\Documents\web\MEAN\very Mean\node_modules\meanio\node_modules\mean-health
> node ./postinstall.js
|
> mean-cli#0.9.26 preinstall E:\Users\Ben\Documents\web\MEAN\very Mean\node_modules\meanio\node_modules\mean-cli
> node ./scripts/preinstall
/
> meanio#0.7.1 postinstall E:\Users\Ben\Documents\web\MEAN\very Mean\node_modules\meanio
> cd ./lib/core_modules/server && npm install && cd ../../..npm WARN package.json server# No description
npm WARN package.json server# No repository field.
npm WARN package.json server# No README data
-
> kerberos#0.0.9 install E:\Users\Ben\Documents\web\MEAN\very Mean\node_modules\meanio\lib\core_modules\server\node_modules\connect-mongo\node_modules\mongodb\node_modules\kerberos
> (node-gyp rebuild 2> builderror.log) || (exit 0)
E:\Users\Ben\Documents\web\MEAN\very Mean\node_modules\meanio\lib\core_modules\server\node_modules\connect-mongo\node_modules\mongodb\node_modules\kerberos>node
"E:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
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 Visual Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere. [E:\Users\Ben\Documents\web\MEAN\very Mean\node_modules\meanio\lib\core_modules\server\node_modules\connect-mongo\node_modules\mongodb\node_modules\kerberos\build\binding.sln]
> bson#0.2.21 install E:\Users\Ben\Documents\web\MEAN\very Mean\node_modules\meanio\lib\core_modules\server\node_modules\connect-mongo\node_modules\mongodb\node_modules\bson
> (node-gyp rebuild 2> builderror.log) || (exit 0)
E:\Users\Ben\Documents\web\MEAN\very Mean\node_modules\meanio\lib\core_modules\server\node_modules\connect-mongo\node_modules\mongodb\node_modules\bson>node "E:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node
-gyp\bin\node-gyp.js" rebuild
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
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 Visual Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere. [E:\Users\Ben\Documents\web\MEAN\very Mean\node_modules\meanio\lib\core_modules\server\node_modules\connect-mongo\node_modules\mongodb\node_modules\bson\build\binding.sln]
method-override#1.0.2 node_modules\method-override
└── methods#1.0.0
gridfs-stream#0.5.3 node_modules\gridfs-stream
cookie-parser#1.3.4 node_modules\cookie-parser
├── cookie-signature#1.0.6
└── cookie#0.1.2
express-validator#2.9.0 node_modules\express-validator
└── validator#3.34.0
passport#0.2.1 node_modules\passport
├── passport-strategy#1.0.0
└── pause#0.0.1
express-session#1.10.4 node_modules\express-session
├── utils-merge#1.0.0
├── cookie-signature#1.0.6
├── cookie#0.1.2
├── on-headers#1.0.0
├── parseurl#1.3.0
├── depd#1.0.0
├── crc#3.2.1
├── debug#2.1.3 (ms#0.7.0)
└── uid-safe#1.1.0 (base64-url#1.2.1, native-or-bluebird#1.1.2)
express#4.12.3 node_modules\express
├── merge-descriptors#1.0.0
├── methods#1.1.1
├── utils-merge#1.0.0
├── fresh#0.2.4
├── cookie-signature#1.0.6
├── cookie#0.1.2
├── escape-html#1.0.1
├── range-parser#1.0.2
├── vary#1.0.0
├── finalhandler#0.3.4
├── parseurl#1.3.0
├── content-type#1.0.1
├── serve-static#1.9.2
├── content-disposition#0.5.0
├── path-to-regexp#0.1.3
├── depd#1.0.0
├── qs#2.4.1
├── debug#2.1.3 (ms#0.7.0)
├── etag#1.5.1 (crc#3.2.1)
├── on-finished#2.2.0 (ee-first#1.1.0)
├── proxy-addr#1.0.7 (forwarded#0.1.0, ipaddr.js#0.1.9)
├── send#0.12.2 (destroy#1.0.3, ms#0.7.0, mime#1.3.4)
├── type-is#1.6.1 (media-typer#0.3.0, mime-types#2.0.10)
└── accepts#1.2.5 (negotiator#0.5.1, mime-types#2.0.10)
connect-mongo#0.4.2 node_modules\connect-mongo
└── mongodb#1.4.35 (readable-stream#1.0.33, kerberos#0.0.9, bson#0.2.21)
> mean#0.4.3 postinstall E:\Users\Ben\Documents\web\MEAN\very Mean
> node node_modules/meanio/node_modules/mean-cli/bin/mean-postinstall
Installing Bower dependencies
Auto installing package dependencies
Dependencies installed for package articles
Dependencies installed for package system
Dependencies installed for package users
Dependencies installed for package theme
Package not found.
Package not found.
Package not found.
meanio#0.7.1 node_modules\meanio
├── complex-list#0.1.4
├── dependable-list#0.1.1
├── lazy-dependable#0.2.0
├── q#1.2.0
├── uglify-js#2.4.19 (uglify-to-browserify#1.0.2, async#0.2.10, yargs#3.5.4, source-map#0.1.34)
├── glob#4.5.3 (inherits#2.0.1, inflight#1.0.4, once#1.3.1, minimatch#2.0.4)
├── mean-health#0.1.7
├── request#2.54.0 (caseless#0.9.0, aws-sign2#0.5.0, forever-agent#0.6.0, form-data#0.2.0, json-stringify-safe#5.0.0, oauth-sign#0.6.0, stringstream#0.0.4, tunnel-agent#0.4.0, isstream#0.1.2, qs#2.4.1, node-uuid#1.4.3, mime-types#2.0.10, combined-stream#0.0.7, http-signature#0.10.1, tough-cookie#0.12.1, bl#0.9.4, hawk#2.3.1, har-validator#1.5.1)
└── mean-cli#0.9.26 (opener#1.4.1, async-series#0.0.1, progress#1.1.8, commander#2.7.1, chalk#0.5.1, shelljs#0.3.0, prompt#0.2.14, json-file-plus#2.0.0, inquirer#0.8.2, bower#1.4.0, npm#2.7.4)
I already have .NET framework installed and visual studio. I have mongodb, node, git, bower, mean-cli, and gulp all installed.
Any ideas?
Using Windows 7. Thanks in advance!
Did you solve your problem? I solved a similar problem a few days ago, but for that I had tried to install mongodb using npm, instead of MEAN.IO.
I solved my problem with this command:
npm install --msvs_version=2013 mongodb
"--msvs_version=2013" because the Visual Studio on my machine is the 2013 version.

express is not recognized in cmd in windows 7

js on my windows 7 machine, i have executed the below commands from
C:\node> npm install -g express -generator
and also C:\node> npm install -g express -generator#4, and also the npm link express
for the above commands, i got the below messages.
express#4.10.7 C:\Users\user1\AppData\Roaming\npm\node_modules\express
├── methods#1.1.1
├── finalhandler#0.3.3
├── cookie-signature#1.0.5
├── serve-static#1.7.2
├── merge-descriptors#0.0.2
├── utils-merge#1.0.0
├── range-parser#1.0.2
├── media-typer#0.3.0
├── cookie#0.1.2
├── content-disposition#0.5.0
├── parseurl#1.3.0
├── vary#1.0.0
├── escape-html#1.0.1
├── fresh#0.2.4
├── path-to-regexp#0.1.3
├── depd#1.0.0
├── qs#2.3.3
├── on-finished#2.2.0 (ee-first#1.1.0)
├── etag#1.5.1 (crc#3.2.1)
├── debug#2.1.1 (ms#0.6.2)
├── type-is#1.5.5 (mime-types#2.0.7)
├── accepts#1.1.4 (negotiator#0.4.9, mime-types#2.0.7)
├── send#0.10.1 (destroy#1.0.3, ms#0.6.2, mime#1.2.11, on-finished#2.1.1)
└── proxy-addr#1.0.4 (forwarded#0.1.0, ipaddr.js#0.1.5)
and with npm link express:
C:\node\node_modules\express -> C:\Users\user1\AppData\Roaming\npm\node_modul
es\express
but still when i execute the express nodetest1 at C:/node> i am getting the express is not recognized error.
anyone know any pointers would be helpful.
You have a space between express and -generator above... if this was copy-pasted, maybe you missed it... it's supposed to be express-generator as a single unit.
Make certain that %USERPROFILE%\AppData\Roaming\npm both exists and is in your PATH environment variable... If it isn't there, you will have to open a new prompt after adding it. Some versions of node's installer don't always create or add it correctly.
If you are using [nvm for windows] you will need to ensure that C:\Program Files\nodejs is in your path (the installer should work correctly), you'll need to run nvm via command prompt Run as Administrator. This is because nvm uses symbolic links from the global install path to a specific version under your profile to run against.
I've been using nvm for windows for a few months now (switching from 0.10.x and 0.11.x versions) and it's been a bit easier to work with.
Make sure you are runing the command promt as System Administrator "This is very important", then do npm install -g express after that chang to the directory where you want to create your app and you are good to go. NB if you are using express 4 then install it via npm install -g express-generator#4

Resources