Nodejs is installed but not NPM - npm

I have installed nodejs on ubuntu 15.10 :
sudo apt-get install nodejs
npm should come with nodejs but when I do npm -v, it says that it is not installed.
So I have tried to install it :
sudo apt-get install npm
but I am getting :
The following packages have unmet dependencies: npm : Depends: nodejs
but it is not going to be installed
Depends: nodejs-dev
Depends: node-request but it is not going to be installed
Depends: node-mkdirp but it is not going to be installed
Depends: node-minimatch but it is not going to be installed
Depends: node-semver but it is not going to be installed
Depends: node-ini but it is not going to be installed
Depends: node-graceful-fs but it is not going to be installed
Depends: node-abbrev but it is not going to be installed
Depends: node-nopt but it is not going to be installed
Depends: node-fstream but it is not going to be installed
Depends: node-rimraf but it is not going to be installed
Depends: node-tar but it is not going to be installed
Depends: node-which but it is not going to be installed E: Unable to correct problems, you have held broken packages.
If anyone knows how to solve this,...
Thank you

Can you try to
sudo apt-get install --reinstall nodejs
and post any errors and/or version of nodejs after reinstall.

Related

Why am I unable to install expo cli?

I have followed the documentation from Expo website, installed NodeJs, git, watachmann, however I m still getting errors when installing Expo cli:
First, ensure you use the recommended version of nodejs. For that, you can use the n module:
// if you haven't installed it before
sudo npm install n -g
//to have the latest stable version
sudo n stable
Then delete all your preview installs with npm and start over. For expo-cli:
sudo npm uninstall --global expo-cli
sudo npm install --global expo-cli

Problem installing npm in laravel framework "Pip install npm"

I am writing this code
pip install npm
But in the terminal it returns:
Requirement already satisfied: npm in c:\programm files\python36\lib\site-packages
How can I solve it?

Gulp-cli version is not updating

I've updated gulp from v 3.9.0 to 4.0.0. When I run gulp i get error Cannot read property 'apply' of undefined. I've read that this is because of gulp-cli version 3.9.0 and I need to update to 2.1.0
On my local machine i've got all to work, and the versions are:
CLI Version: 2.1.0
Local Version: 4.0.0
But on our dev-server the CLI-version won't change and it's stuck at 3.9.0.
I have uninstalled both gulp and gulp-cli, removed the node_modules folder. Installed it again and it's the correct versions in the package.json.
"gulp": "^4.0.0",
"gulp-cli": "^2.1.0",
But when i run gulp -v now it still outputs CLI Version: 3.9.0..
Someone familiar with this? gulp 3.9.0 is globally installed on the server, can this cause the problem?
First uninstall your current versions of Gulp and Gulp CLI:
npm uninstall gulp --save-dev
npm uninstall gulp -g
then go ahead and reinstall Gulp version 4.0.0:
npm install gulp-cli -g
npm install gulp#4.0.0

how to downgrade angular-cli 1.7.3 to angular-cli 1.6.8

I am getting issue in my Ubuntu regarding reinstalling of angular.
my current version:
Angular 1.7.3
Node: 8.11.1
OS: Linux
Angular: 4.4.4
I want to reinstall from angular 1.7.3 to angular 1.6.8
Please help..
Correct command now is this:
npm uninstall -g angular-cli
npm cache clean --force
npm install #angular/cli#1.6.8
The key here is first # before angular and angular/cli not angular-cli.
You can uninstall the current version of angular cli- 1.7.3 and install 1.6.8
npm uninstall -g angular-cli
npm cache clean
npm install -g angular-cli#1.6.8

how to install node 4.4.7 and npm 3.8.9?

By default node 4.4.7 comes with npm 2.15.8 version.
How can I modify npm version to 3.8.9 with same node version?
npm update #npm3.8.9 or upgrade didn't do.
Try like this
npm install npm#3.8.9
If you want to install latest version of npm
npm install npm#latest
here latest is the keyword
We can also upgrade node via npm
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
The n package represents a Node helper, and running the last command upgrades node to the latest stable version. Instead of using "stable", you could specify a desired version:
To upgrade, run: [sudo] npm install npm#latest -g if you don't want the latest provide the version number there