#vue-cli install error, Can't install vue-cli - node.js

$ npm i -g #vue/cli
npm WARN deprecated hoek#5.0.4: This version is no longer maintained.Please upgrade to the latest version.
npm WARN deprecated cross-spawn-async#2.2.5: cross-spawn no longer requires a build toolchain, use it instead
/Users/terryakishin/.npm-global/bin/vue -> /Users/terryakishin/.npm-global/lib/node_modules/#vue/cli/bin/vue.js
+ #vue/cli#3.2.1
updated 3 packages in 37.486s
$ vue --version
-bash: vue: command not found
$ vue create front
-bash: vue: command not found
Any idea what I'm doing wrong here? Please answer me why it didn't work. As soon as updating the MacOS, vue.js didn't work.
$ node -v
v8.11.3
$ npm -v
5.6.0

Related

Downgrade Nodejs and Npm

Hello everyone how i can downgrade my version of nodejs and npm under ubuntu ?
Thanks,
You can downgrade npm by simple pasting a needed version:
For example:
npm install -g npm#3.10.10
Be sure that it's downgraded:
npm -v
To downgrade nodejs, you can also do so by simple pasting a needed version.
For example:
$ npm install -g n
$ n 6.10.3
Be sure that it's downgraded:
$ node -v
v6.10.3

Can't install latest angular cli on ubuntu

I'm trying to install angular via ubuntu.
When I type the version commande node -v
I get v12.14.1
Then I try to install npm package sudo npm install -g #angular/cli
I get a warning
npm WARN npm npm does not support Node.js v10.15.2
ng version
I get angular-cli: 1.0.0-beta.28.3
The npm version is 6.13.4
The issue here seems to be that sudo node -v gives 10.15.2 where as node -v gives 12.14.1.
This means that there are 2 different node versions installed.
You can get around this by using sudo -E node -v or by deleting the link to the other node.js install by doing: rm /usr/local/bin/node.

installed latest version of node -- but npm is broken (mac)

OK so, I went to the nodejs.org webpage, downloaded node version 7.5.0, installed it using the easy to use wizard.
It installed with no errors or issues.
When I open up my terminal, node -v gives me v7.5.0, and npm -v gives me 3.6.0.
Obviously I want the latest version of npm, so I go to npm install npm#latest -g, but I get this error:
Cannot find module 'internal/fs'
In fact, trying to install ANYTHING using npm results in the same error.
How do I fix npm?
Try uninstalling your current node version and reinstall using nvm or brew:
To find where node lives: command -v node && command -v npm
Remove these directories as stated in some of the comments here: https://github.com/nodejs/node/issues/9377
Posting this for anyone passing by. You can use npm up -g to update the npm version. Here's output from my console installing node 4.7.3 via nvm:
user#localhost:~/Desktop/demo$ nvm install 4.7.3
Downloading and installing node v4.7.3...
Downloading https://nodejs.org/dist/v4.7.3/node-v4.7.3-darwin-x64.tar.gz...
######################################################################## 100.0%
Computing checksum with shasum -a 256
Checksums matched!
Now using node v4.7.3 (npm v2.15.11)
user#localhost:~/Desktop/demo$ npm up -g
/Users/user/.nvm/versions/node/v4.7.3/bin/npm -> /Users/user/.nvm/versions/node/v4.7.3/lib/node_modules/npm/bin/npm-cli.js
npm#4.2.0 /Users/user/.nvm/versions/node/v4.7.3/lib/node_modules/npm
user#localhost:~/Desktop/demo$ npm -v
4.2.0
user#localhost:~/Desktop/demo$

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

Node and NPM versions don't match

The node and npm versions on my mac dont match. How do I downgrade npm to the same version as node?
Node:
$ node -v
$ v0.12.7
NPM:
$ npm -v
$ 2.14.4
npm is a package manager for node.js. They don't have to be the same version. npm also gets updated more frequently than node, so they could not be expected to keep their versions the same
If it helps, you can install any version of NPM. On debian distros, to use npm version 4.5.0 you need to do:
$ curl https://registry.npmjs.org/npm/-/npm-4.5.0.tgz
$ tar -xvzf npm-4.5.0.tgz
$ cd package/
$ [sudo] make install
Their versions are different because they are independent softwares. Their development is not synchronized.
I recommend updating NPM when you can; I'm running npm version 5.2.0
You can easily upgrade your NPM version using npm install -g npm

Resources