Unable to uninstall express in Ubuntu 13.x - node.js

I have express installed, but it no longer works. When I type 'express' in the terminal I get:
bash: /usr/local/bin/express: No such file or directory
If I try and uninstall I get...
sudo npm uninstall –g express
npm WARN uninstall not installed in /home/user/expressApps/sausage/node_modules: "–g"
npm WARN uninstall not installed in /home/user/expressApps/sausage/node_modules: "express"
Or if I try and re-install I get...
sudo npm install –g express
npm WARN package.json application-name#0.0.1 No README.md file found!
npm http GET https://registry.npmjs.org/express/3.12.1
npm http GET https://registry.npmjs.org/%E2%80%93g
npm http 404 https://registry.npmjs.org/%E2%80%93g
npm ERR! 404 '%E2%80%93g' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.
npm ERR! System Linux 3.11.0-24-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "–g" "express"
npm ERR! cwd /home/johnmlocklear/expressApps/sausage
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18
npm ERR! code E404
npm http 304 https://registry.npmjs.org/express/3.12.1
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/johnmlocklear/expressApps/sausage/npm-debug.log
npm ERR! not ok code 0
How can I get express working again?

So I think my issue was that I had installed express from the apt-get repo using
sudo apt-get install express
Then after that at some point I also had installed from npm. To clean all this up I ran
sudo apt-get uninstall express
...and I also went into ~/.npm and removed both express and express-genrator folders. I then ran both...
sudo npm install -g express
sudo npm install -g express-generator
...and all seems to working OK now.

The big clues to me are in these error lines:
npm http GET https://registry.npmjs.org/%E2%80%93g
npm http 404 https://registry.npmjs.org/%E2%80%93g
npm ERR! 404 '%E2%80%93g' is not in the npm registry.
That %E2%80%93g (note the g at the end) seems crazy. And it seels to be directly connected to this line:
sudo npm install –g express
That – next to the g is not a simple dash but some UTF-8 character that has been url encoded. Pretty sure that is an en-dash since a url encoded %E2%80%93 equals e28093 in hex as shown here. That most likely came from a copy & paste out of a text editor that somehow automatically sets simple dashes to en-dashed. Be careful of stuff like that when storing code & cheats heats.
To fix it, run the command with a real dash - like this:
sudo npm install -g express
The other issue I see is this:
bash: /usr/local/bin/express: No such file or directory
So where is that /usr/local/bin/express coming from? If express wasn’t in your path then you wouldn’t even get a full-path message like that? Is that a bash alias in your profile? If you set that yourself, I would highly recommend just adding /usr/local/bin/ to your shell path instead of setting an alias.

Related

npm ERR! install electron-packager

I am creating a new electron app and now I need to install electron-packager in it.
node -v v10.16.0 & npm -v v6.9.0
(I updated both)
I have tried to run this:
npm install electron-packager --save-dev
and this:
npm install electron-packager -g
The Error:
npm ERR! code E404
npm ERR! 404 Not Found - GET http://registry.npmjs.org/electron-packager
npm ERR! 404
npm ERR! 404 'electron-packager#latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
What can I do?
Thanks!
It would be better if you specified the OS.
I once faced this problem and downgrading node to v8.0 fixed this problem.
But I would strongly recommend you to use electron-builder(https://github.com/electron-userland/electron-builder) instead of electron-packager for creating installer packages, as it is a lot easier with lot more options including built-in auto-update feature.

unable to install firebase tools cli using windows 10

Hi i unable to install the firebase tools via commandline in the windows
im using this below command
npm install -g firebase-tools
after entering this command i m getting this below error
npm ERR! path C:\Users\data\AppData\Roaming\npm\node_modules\firebase-tools\node_modules
npm ERR! code ELOOP
npm ERR! errno -4067
npm ERR! syscall mkdir
npm ERR! ELOOP: too many symbolic links encountered, mkdir 'C:\Users\data\AppData\Roaming\npm\node_modules\firebase-tools\node_modules'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\data\AppData\Roaming\npm-cache_logs\2018-01-20T13_22_41_404Z-debug.log
Latest version seems to have a problem.
Try installing one previous version:
npm i -g firebase-tools#v3.17.2
UPDATE:
Before doing so, it might be better to uninstall faulty one:
npm uninstall -g firebase-tools
also make sure you have windows-build-tools installed (though I have it on my machines, error you share doesn't really seem to be related to this)
npm --add-python-to-path='true' --debug install --global windows-build-tools
UPDATE 2
I've updated my Node & NPM versions and then to latest Firebase Tools.
Still getting WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1 error, but since it's a warning, I've decided to give it a try. So far no problems.
UPDATE 3
windows-build-tools package got an update yesterday so I installed it with hope it solves problems installing latest version of firebase-tools. It did not, same errors occur.
Actually you can try installing the
npm i -g firebase-tools#v3.16.0 version and try to install the
npm install windows-build-tools**in your local folder and after that install
**npm install node-gyp in your local folder and before doing all these try to disable your antivirus
npm ERR! code E404 npm ERR! 404 Not Found - GET https://registry.npmjs.org/#google-cloud%2fpubsub/firebase-tools/firebase-tools npm ERR! 404 npm ERR! 404 'firebase-tools#latest' is not in the npm registry. npm ERR! 404 You should bug the author to publish it (or use the name yourself!) npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, http url, or git url. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\jsmma\AppData\Roaming\npm-cache_logs\2020-05-02T14_58_23_615Z-debug.log

Can't run npm install in an Ember CLI application?

I am setting up an Ember application on a new laptop. I installed node, npm through brew and I also have the Ember CLI. Within the Ember CLI app, I'm trying to do an npm install but when I do, I get this error in the terminal:
npm WARN package.json npm#1.4.21 Non-dependency in bundleDependencies: inherits
npm ERR! Darwin 14.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.10.33
npm ERR! npm v2.1.11
npm ERR! code E404
npm ERR! 404 Not Found: expresss
npm ERR! 404
npm ERR! 404 'expresss' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'ember-cli'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/Nagarjun/Code/sumo-list/web-client/npm-debug.log
I can't run my projects until this is resolved. What am I missing? I even Googled but couldn't find anything for expresss.
My guess is 'expresss' (with an extra s) is a package on npm that was pulled. The dependency was in fact listed in the package.json file for ember-cli but I don't think anyone ever noticed it until later versions.
Proof: https://github.com/stefanpenner/ember-cli/blob/ec8a6ab898599746bddbb8f72f7633c29f0ee95b/package.json#L58
I was able to resolve this issue by uninstalling node and npm completely using brew. Then, installing node.js using the package from nodejs.org. Now, my npm version is 1.4.28. Looks like the issue was caused by the newer npm 2.1.10. Not sure why brew automatically picks up the new npm.
Look in your package.json dependencies section. Looks like a typo.
I faced the same issue but it got fixed by running sudo npm install -g ember-cli

error when type 'sudo npm install -g meteorite'

I'm trying to install the meteorite. I've success to install nodejs(v0.10.7).and when I type 'sudo npm install -g meteorite'. It comes the error below. I think it may exist some problem with npm(1.2.21). But I do not how to solve it. And I use ubuntu12.10 64bit. Any ideas?
npm http GET https://registry.npmjs.org/meteorite
npm http 304 https://registry.npmjs.org/meteorite
npm ERR! Error: ENOTDIR, mkdir '/home/icarus/tmp/npm-5885/1369411459617-0.27502001402899623'
npm ERR! If you need help, you may report this log at:
npm ERR! or email it to:
npm ERR! npm-#googlegroups.com
npm ERR! System Linux 3.5.0-17-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "meteorite"
npm ERR! cwd /home/icarus
npm ERR! node -v v0.10.7
npm ERR! npm -v 1.2.21
npm ERR! not ok code 0
For those who landed here first like me, this is usually an issue with a tmp folder in your root directory followed by npm trying to install from the cache. This should fix it:
rm -rf ~/tmp
sudo npm cache clear
sudo npm install -g meteorite
If you still get the ENOTDIR error you can try making the directory yourself, clearing the cache, and reinstalling, but it looks like removing the tmp folder usually does the trick.
Props to Coombesy for posting this solution here.

Trouble installing tower module - ws module crashes

I'm new to node.js and I have installed it by running the installation from the node website. I've had a play installing packages globally (e.g. should) but now I'm trying to install the tower module on my Mac, like so:
sudo npm install tower -g
It install a bunch of stuff and then crashes, with output
npm http 304 https://registry.npmjs.org/tinycolor
npm http 304 https://registry.npmjs.org/zeparser/0.0.5
> ws#0.4.20 install /usr/local/lib/node_modules/tower/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
> node install.js
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
node.js:520
var cwd = process.cwd();
^
Error: EACCES, permission denied
at Function.startup.resolveArgv0 (node.js:520:23)
at startup (node.js:54:13)
at node.js:611:3
npm ERR! ws#0.4.20 install: `node install.js`
npm ERR! `sh "-c" "node install.js"` failed with 11
npm ERR!
npm ERR! Failed at the ws#0.4.20 install script.
npm ERR! This is most likely a problem with the ws package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls ws
npm ERR! There is likely additional logging output above.
If I read that correctly it's the ws (websockets?) module crashing.
In researching this problem a blog suggested I add the node path to my .bashrc so I have done that.
Any suggestions?
At this line:
ws#0.4.20 install /usr/local/lib/node_modules/tower/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws
We see that ws is install in /usr/local/lib, I need root to write here no ?
I'm using linux, it's maybe not the case in mac...
You should use sudo npm install -g tower or install Node.js with nvm. Nvm cares that modules are install in your home, so you do not need sudo.
After much experimentation the only thing that worked for me was to enable the OSX root account, and then:
su
npm install -g tower
sudo did not work but su did.

Resources