npm disappeared after running update - node.js

I was following a tutorial over at nettutsplus, and after running npm update -g npm, my npm no longer exists when i type which npm. here are the errors. what went wrong and how can i fix it?
localhost:~ macgeekalex$ npm update -g npm
npm http GET https://registry.npmjs.org/npm
npm http 200 https://registry.npmjs.org/npm
npm http GET https://registry.npmjs.org/npm/-/npm-1.3.1.tgz
npm http 200 https://registry.npmjs.org/npm/-/npm-1.3.1.tgz
npm http GET https://registry.npmjs.org/npm/1.3.1
npm http 200 https://registry.npmjs.org/npm/1.3.1
npm http GET https://registry.npmjs.org/npm/-/npm-1.3.1.tgz
npm http 200 https://registry.npmjs.org/npm/-/npm-1.3.1.tgz
npm ERR! error rolling back Error: EACCES, unlink '/usr/local/lib/node_modules/npm'
npm ERR! error rolling back npm#1.3.1 { [Error: EACCES, unlink '/usr/local/lib/node_modules/npm']
npm ERR! error rolling back errno: 3,
npm ERR! error rolling back code: 'EACCES',
npm ERR! error rolling back path: '/usr/local/lib/node_modules/npm' }
npm ERR! Error: EACCES, unlink '/usr/local/lib/node_modules/npm'
npm ERR! { [Error: EACCES, unlink '/usr/local/lib/node_modules/npm']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/npm' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 12.3.0
npm ERR! command "node" "/usr/local/bin/npm" "update" "-g" "npm"
npm ERR! cwd /Volumes/Prodigy RAIDER PRO/Users/macgeekalex
npm ERR! node -v v0.10.12
npm ERR! npm -v 1.2.32
npm ERR! path /usr/local/lib/node_modules/npm
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, unlink '/usr/local/lib/node_modules/npm'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Volumes/Prodigy RAIDER PRO/Users/macgeekalex/npm-debug.log
npm ERR! not ok code 0

See the FAQ
How do I update npm?
npm update npm -g
npm update npm -g You can also update all
outdated local packages by doing npm update without any arguments, or
global packages by doing npm update -g.
Occasionally, the version of npm will progress such that the current
version cannot be properly installed with the version that you have
installed already. (Consider, if there is ever a bug in the update
command.)
In those cases, you can do this:
curl https://npmjs.org/install.sh | sh
Update
The install script location has been moved since, so try:
curl -L https://npmjs.org/install.sh | sh

Related

npm update -g makes my npm gone

I man on Mac OSX and want to perform a npm update to update all globally installed stuff.
After executing npm update -g, I got a lot of erros and npm is gone, like this:
localhost:~ myname$ npm
-bash: npm: command not found
I Googled but don't remember how I installed node. It seems it's not installed via brew, so that I can't use brew to un/reinstall node/npm.
-- UPDATE --
After checking the comments on some other links I decide to just reinstall node and my npm is back. But when I try to use npm install -g npm to update again, the issue returns. Here is the full stuff from my terminal:
localhost:~ myname$ npm install -g npm
npm ERR! Darwin 14.1.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "npm"
npm ERR! node v0.12.1
npm ERR! npm v2.5.1
npm ERR! path /usr/local/lib/node_modules/npm
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! Error: EACCES, unlink '/usr/local/lib/node_modules/npm'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES, unlink '/usr/local/lib/node_modules/npm']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/npm' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! error rolling back Error: EACCES, unlink '/usr/local/lib/node_modules/npm'
npm ERR! error rolling back at Error (native)
npm ERR! error rolling back { [Error: EACCES, unlink '/usr/local/lib/node_modules/npm']
npm ERR! error rolling back errno: -13,
npm ERR! error rolling back code: 'EACCES',
npm ERR! error rolling back path: '/usr/local/lib/node_modules/npm' }
npm ERR! Please include the following file with any support request:
npm ERR! /Users/myname/npm-debug.log
localhost:~ myname$ npm
-bash: /usr/local/bin/npm: No such file or directory
What should I do?
Thanks!
The error says literally: Please try running this command again as root/Administrator. It means you need to update/install with administrator privileges. To do so use "sudo":
sudo npm update -g

Unable to run telescope / meteor

Im trying to follow the instructions from http://www.telesc.pe/docs/installing-telescope/
Managed to install node.js and npm using the link on the page. I have also installed meteor and meteorite. I have also pulled the latest update using git clone git#github.com:TelescopeJS/Telescope.git
I can can run another meteor app. (like a demo 'myapp')
But when I try and launch meteor from inside the 'telescope' folder, I get the following:
*Last login: Fri Aug 1 19:52:52 on ttys000
static-239:~ shwaytaj$ cd telescope
static-239:telescope shwaytaj$ meteor
[[[[[ ~/telescope ]]]]]
=> Started proxy.
=> Started MongoDB.
iron-router: updating npm dependencies -- connect...
npm ERR! Error: EACCES, open '/Users/shwaytaj/.npm/inherits/2.0.1/package/package.json'
npm ERR! { [Error: EACCES, open '/Users/shwaytaj/.npm/inherits/2.0.1/package/package.json']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/Users/shwaytaj/.npm/inherits/2.0.1/package/package.json',
npm ERR! parent: 'readable-stream' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 13.0.0
npm ERR! command "/Users/shwaytaj/.meteor/tools/cef2bcd356/bin/node" "/Users/shwaytaj/.meteor/tools/cef2bcd356/bin/npm" "install" "connect#2.9.0"
npm ERR! cwd /Users/shwaytaj/.meteorite/packages/iron-router/EventedMind/iron-router/05415a8891ea87a00fb1e2388585f2ca5a38e0da/.npm/package-new-1efnvtc
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /Users/shwaytaj/.npm/inherits/2.0.1/package/package.json
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open '/Users/shwaytaj/.npm/inherits/2.0.1/package/package.json'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/shwaytaj/.meteorite/packages/iron-router/EventedMind/iron-router/05415a8891ea87a00fb1e2388585f2ca5a38e0da/.npm/package-new-1efnvtc/npm-debug.log
npm ERR! not ok code 0
mailchimp: updating npm dependencies -- mailchimp...
npm ERR! Error: EACCES, mkdir '/Users/shwaytaj/.npm/request/2.39.0'
npm ERR! { [Error: EACCES, mkdir '/Users/shwaytaj/.npm/request/2.39.0']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/Users/shwaytaj/.npm/request/2.39.0',
npm ERR! parent: 'mailchimp' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 13.0.0
npm ERR! command "/Users/shwaytaj/.meteor/tools/cef2bcd356/bin/node" "/Users/shwaytaj/.meteor/tools/cef2bcd356/bin/npm" "install" "mailchimp#1.0.3"
npm ERR! cwd /Users/shwaytaj/telescope/packages/mailchimp/.npm/package-new-55uyws
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /Users/shwaytaj/.npm/request/2.39.0
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/Users/shwaytaj/.npm/request/2.39.0'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/shwaytaj/telescope/packages/mailchimp/.npm/package-new-55uyws/npm-debug.log
npm ERR! not ok code 0
fast-render: updating npm dependencies -- connect...
npm ERR! Error: EACCES, open '/Users/shwaytaj/.npm/inherits/2.0.1/package/package.json'
npm ERR! { [Error: EACCES, open '/Users/shwaytaj/.npm/inherits/2.0.1/package/package.json']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/Users/shwaytaj/.npm/inherits/2.0.1/package/package.json',
npm ERR! parent: 'readable-stream' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 13.0.0
npm ERR! command "/Users/shwaytaj/.meteor/tools/cef2bcd356/bin/node" "/Users/shwaytaj/.meteor/tools/cef2bcd356/bin/npm" "install" "connect#2.13.0"
npm ERR! cwd /Users/shwaytaj/.meteorite/packages/fast-render/arunoda/meteor-fast-render/149984b1aff3a5642a270aff9bd9006872c8302e/.npm/package-new-1c6pww9
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /Users/shwaytaj/.npm/inherits/2.0.1/package/package.json
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open '/Users/shwaytaj/.npm/inherits/2.0.1/package/package.json'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/shwaytaj/.meteorite/packages/fast-render/arunoda/meteor-fast-render/149984b1aff3a5642a270aff9bd9006872c8302e/.npm/package-new-1c6pww9/npm-debug.log
npm ERR! not ok code 0
=> Errors prevented startup:
While building package `iron-router`:
error: couldn't install npm package
While building package `mailchimp`:
error: couldn't install npm package
While building package `fast-render`:
error: couldn't install npm package
=> Your application has errors. Waiting for file change.*
Seems like you were using sudo too much. Make sure that you're the owner of all files within ~/.npm and ~/.meteorite, so basically
sudo chown -R username:username ~/.npm ~/.meteorite
You're probably getting this because you did:
sudo npm install -g meteorite
If you do sudo mrt in the teloscope app folder it will probably run fine.
If you want to resolve the issue you will need to fix your permissions, you can do:
sudo chown -R whoami ~/.npm
See here for more:
https://github.com/oortcloud/meteorite/

npm update error while trying to install ionic

I've got problems trying to install NPM.
Always worked well, but now, i've to install "ionic" and the problem is that when i tried to re-install nodejs all work well, it seems that npm installed but trying to update it, it gives me errors, so i tried to update it via this command:
curl https://www.npmjs.org/install.sh | sh
I cannot install ionic, i don't know why. I've installed months ago cordova and phonegap, but ionic gives me trouble.
Reading guides, tell me to update my npm and doing this, that what i've (this is the following error using the command above)
cleanup prefix=/usr/local
All clean!
unbuild npm#1.4.14
npm ERR! Error: EACCES, unlink '/usr/local/lib/node_modules/npm'
npm ERR! { [Error: EACCES, unlink '/usr/local/lib/node_modules/npm']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/npm' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 13.2.0
npm ERR! command "/usr/local/bin/node" "/private/var/folders/ry/gd7h2rhs52n10yr83_w50wyw0000gp/T/npm.18934/package/cli.js" "rm" "npm" "-gf"
npm ERR! cwd /private/var/folders/ry/gd7h2rhs52n10yr83_w50wyw0000gp/T/npm.18934/package
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.16
npm ERR! path /usr/local/lib/node_modules/npm
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, unlink '/usr/local/lib/node_modules/npm'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /private/var/folders/ry/gd7h2rhs52n10yr83_w50wyw0000gp/T/npm.18934/package/npm-debug.log
npm ERR! not ok code 0
> npm#1.4.16 prepublish .
> node bin/npm-cli.js prune --prefix=. --no-global && rm -rf test/*/*/node_modules && make -j32 doc
make: Nothing to be done for `doc'.
npm ERR! error rolling back Error: EACCES, unlink '/usr/local/lib/node_modules/npm'
npm ERR! error rolling back npm#1.4.16 { [Error: EACCES, unlink '/usr/local/lib/node_modules/npm']
npm ERR! error rolling back errno: 3,
npm ERR! error rolling back code: 'EACCES',
npm ERR! error rolling back path: '/usr/local/lib/node_modules/npm' }
npm ERR! Error: EACCES, unlink '/usr/local/lib/node_modules/npm'
npm ERR! { [Error: EACCES, unlink '/usr/local/lib/node_modules/npm']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/npm' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 13.2.0
npm ERR! command "/usr/local/bin/node" "/private/var/folders/ry/gd7h2rhs52n10yr83_w50wyw0000gp/T/npm.18934/package/cli.js" "install" "-gf"
npm ERR! cwd /private/var/folders/ry/gd7h2rhs52n10yr83_w50wyw0000gp/T/npm.18934/package
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.16
npm ERR! path /usr/local/lib/node_modules/npm
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, unlink '/usr/local/lib/node_modules/npm'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /private/var/folders/ry/gd7h2rhs52n10yr83_w50wyw0000gp/T/npm.18934/package/npm-debug.log
npm ERR! not ok code 0
Solved using the command sudo su on my mac os x (so without using sudo with the commando or sudo $username).
then using the curl commando it run.
Thanks however.
Might this answer could be usefull
Try this:
rm -rf /usr/local/lib/node_modules/npm
sudo curl https://www.npmjs.org/install.sh | sh

Error Installing ExpressJS via npm

I am running into an issue when I try to run "npm install -g express" and "npm install -g express-generator". Here is the error message for both. I have been able to install Express in the past by using package.json, but not through npm. Any ideas? :
"npm install -g express":
npm http GET https://registry.npmjs.org/express
npm http 304 https://registry.npmjs.org/express
npm ERR! error rolling back Error: EACCES, unlink '/usr/local/lib/node_modules/express'
npm ERR! error rolling back express#4.3.1 { [Error: EACCES, unlink '/usr/local/lib/node_modules/express']
npm ERR! error rolling back errno: 3,
npm ERR! error rolling back code: 'EACCES',
npm ERR! error rolling back path: '/usr/local/lib/node_modules/express' }
npm ERR! Error: EACCES, unlink '/usr/local/lib/node_modules/express'
npm ERR! { [Error: EACCES, unlink '/usr/local/lib/node_modules/express']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/express' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 13.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "express"
npm ERR! cwd /Users/user/Desktop/Projects/node
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! path /usr/local/lib/node_modules/express
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, unlink '/usr/local/lib/node_modules/express'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/user/Desktop/Projects/node/npm-debug.log
npm ERR! not ok code 0
"npm install -g express-generator":
npm http GET https://registry.npmjs.org/express-generator
npm http 200 https://registry.npmjs.org/express-generator
npm http GET https://registry.npmjs.org/express-generator/-/express-generator-4.2.0.tgz
npm http 200 https://registry.npmjs.org/express-generator/-/express-generator-4.2.0.tgz
npm ERR! error rolling back Error: EACCES, unlink '/usr/local/lib/node_modules/express-generator'
npm ERR! error rolling back express-generator#4.2.0 { [Error: EACCES, unlink '/usr/local/lib/node_modules/express-generator']
npm ERR! error rolling back errno: 3,
npm ERR! error rolling back code: 'EACCES',
npm ERR! error rolling back path: '/usr/local/lib/node_modules/express-generator' }
npm ERR! Error: EACCES, unlink '/usr/local/lib/node_modules/express-generator'
npm ERR! { [Error: EACCES, unlink '/usr/local/lib/node_modules/express-generator']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/express-generator' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 13.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "express-generator"
npm ERR! cwd /Users/user/Desktop/Projects/node
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! path /usr/local/lib/node_modules/express-generator
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, unlink '/usr/local/lib/node_modules/express-generator'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/user/Desktop/Projects/node/npm-debug.log
npm ERR! not ok code 0
Did you try with sudo? It looks like the current user does not have access to /usr/local/lib.
By the way, you want to install express-generator globally for the project generator nowadays, not the express package globally anymore.
this is permission issue..
if you use without sudo, using this commandline..
sudo chown -R `whoami` ~/.npm
npm throws error without sudo
this link is best answer to you.
Run cmd as Administrator and try installing it again. It worked for me.
I had same problem.
I had command "npm cache clean" -> not work
ulimit -n 2560 -> not work
so I
delete .npm directory and run this command "npm search -g"
and removed some module -> in my case grunt*
that works for me.

Trouble installing Yeoman

Hello all I am attempting to install Yeoman however when I attempt to install the package via npm I get the following error.
sudo npm install -g yeoman
npm http GET https://registry.npmjs.org/yeoman
npm http 200 https://registry.npmjs.org/yeoman
npm http GET https://registry.npmjs.org/yeoman/-/yeoman-0.9.1.tgz
npm http 200 https://registry.npmjs.org/yeoman/-/yeoman-0.9.1.tgz
npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/usr/local/share/npm/lib/node_modules/yeoman/node_modules/grunt/node_modules/nodeunit/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/.bin'
npm ERR! error rolling back yeoman#0.9.1 { [Error: ENOTEMPTY, rmdir '/usr/local/share/npm/lib/node_modules/yeoman/node_modules/grunt/node_modules/nodeunit/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/.bin']
npm ERR! error rolling back errno: 53,
npm ERR! error rolling back code: 'ENOTEMPTY',
npm ERR! error rolling back path: '/usr/local/share/npm/lib/node_modules/yeoman/node_modules/grunt/node_modules/nodeunit/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/.bin' }
npm ERR! Error: ENOTEMPTY, rmdir '/usr/local/share/npm/lib/node_modules/yeoman/node_modules/grunt/node_modules/nodeunit/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/.bin'
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR! System Darwin 11.4.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "yeoman"
npm ERR! cwd /Users/chris
npm ERR! node -v v0.8.9
npm ERR! npm -v 1.1.61
npm ERR! path /usr/local/share/npm/lib/node_modules/yeoman/node_modules/grunt/node_modules/nodeunit/node_modules/tap/node_modules/runforcover/node_modules/bunker/node_modules/burrito/node_modules/.bin
npm ERR! code ENOTEMPTY
npm ERR! errno 53
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/chris/npm-debug.log
npm ERR! not ok code 0
I have used node and npm before but I have never gotten an error like this.
You've got a notempty error when trying to remove a certain folder with rmdir. I'm not exactly sure why that is.. but..
rm -rf /usr/local/share/npm/lib/node_modules/yeoman
sudo npm install -g yeoman

Resources