can't install "npm install -g yo" global only local. - node.js

im triying to install jhipster but I can't install
npm install -g yo
im getting this
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
✖ yo version
Your yo version is outdated.
Upgrade to the latest version by running:
npm install -g yo#latest
Found potential issues on your machine :(
+ yo#2.0.5
but if I run
npm install yo
im not getting any problem
im using
npm -v
6.4.1
node -v
v10.13.0
and macOS Mojave 10.14

I try a different way I run
yarn global add yo
then
export PATH="$PATH:$(yarn global bin):$HOME/.config/yarn/global/node_modules/.bin"
and
yo jhipster
now jhipster is finally working 😀

Related

npm install issues - react native project - mac

I am trying to clone a remote react-native project but I am getting errors when running the npm install command to download all the dependencies in the package.json folder.
I am in the same root directory where the package.json file is.
This is what I get when running npm install:
when I try doing npm install --force or npm install --legacy-deps I get:
I've tried uninstalling node reinstalling to the LTS and current version.
This is the process I followed when trying to install the dependencies:
clone remote repo
npm init
npm install
I am not quite sure what else to do any help would be greatly appreciated.
First you need to get in project directory then install the node packages
cd <ProjectName>
npm install

Cannot Install Npx

I am getting a strange error when trying to install npx. I have node, but it says I don't.
➜ Desktop brew install npm
Warning: node 14.4.0 is already installed and up-to-date
To reinstall 14.4.0, run `brew reinstall node`
➜ Desktop npm install -g npx
zsh: command not found: npm
Why is that happening?
npx is pre-bundled with npm .no need to install npx. if u want to start a new react project (I presume)give npx create-react-app project name given that you installed the latest node version.

Vue-cli generating project stopped

when I try to generate a project with vue-cli, its stopped, that is what i get
>> vue init webpack test
? Project name test
? Project description (A Vue.js project)
Then I cant cancel with ctl + c or something, I hit enter and nothing, im use node v8 and npm v5
I fixed this by first uninstalling the vue-cli by running npm uninstall vue-cli -g then uninstalling my Node.js from the control panel: Then installing the latest current version(not the LTS version) of Node.js then running npm install -g npm then install the vue-cli again using npm install -g vue-cli
In a nutshell update Node.js and npm to the latest versions then install the vue-cli.
Update: In case you use Ubuntu or any Ubuntu base OS:
First, uninstalling the vue-cli by running sudo npm uninstall vue-cli -g then uninstall your current version of Node and install the latest version from here (install the build tools as well) then run sudo npm install -g npm then install the vue-cli again using sudo npm install -g vue-cli

Can't install Yeoman on Ubuntu because my nodejs and npm are outdated

I'm trying to install Yeoman via npm, but I get the following errors when I run npm install -g yo:
npm WARN deprecated npmconf#2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
/home/marieficid/.node/bin/yo -> /home/marieficid/.node/lib/node_modules/yo/lib/cli.js
> yo#1.6.0 postinstall /home/marieficid/.node/lib/node_modules/yo
> yodoctor
Yeoman Doctor
Running sanity checks on your system
✔ Global configuration file is valid
✖ Node.js version
Your Node.js version is outdated.
Upgrade to the latest version: https://nodejs.org
✔ 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
✔ NODE_PATH matches the npm root
Found potential issues on your machine :(
/home/marieficid/.node/lib
└── yo#1.6.0
Which is very odd because when I run node --version && npm --version I get:
v4.3.1
3.7.3
And when I try to run npm install -g n I get:
/home/marieficid/.node/bin/n -> /home/marieficid/.node/lib/node_modules/n/bin/n
/home/marieficid/.node/lib
└── n#2.1.0
I tried running this solution, which only brought me more issues: Now I can't run node --version, only n --version, which returns 2.1.0, and I can't run npm install -g n because I get this:
marieficid#mariana-K46CB:~$ npm install -g n
/usr/bin/env: node: Arquivo ou diretório não encontrado
Which means "directory not found". What can I do? I'm on Ubuntu 14.04, by the way.
EDIT: I think I screwed up my $PATH variable... does anyone know how to fix it?
You should run
npm install -g npm
not
npm install -g n
according to your output

How to install `yeoman` latest version?

I installed the node as new version. once i installed i checked in cmd for like this:
C:\Users\Mohamed.Arif>node --version && npm --version
v0.10.35
1.4.28
But after I installed the node, npm I am trying to install the latest yeoman. in their website, i noted the npm version requires v2.1.0+ - i confused here. how to i install the npm as they requested?
I am running the latest version of node only.
Install prerequisites
Before installing Yeoman, you will need the following:
Node.js v0.10.x+
npm (which comes bundled with Node) v2.1.0+
git
You can check if you have Node and npm installed by typing:
http://yeoman.io/codelab/setup.html
What is wrong here? I am working with windows7.
Thanks in advance!
See How do I update npm on Windows?
tl;dr - npm -g install npm does work, but the old version of npm is still in your PATH.
Option 3: navigate to C:\Program Files (x86)\nodejs with cmd.exe and then run
the installation without -g:
npm install npm

Resources