Install angular on mac - node.js

I'm trying to install Angular on macOS. I have npm 5.6.0 and node 8.11.1 installed. I tried sudo npm install -g #angular/cli, which seems to install it. However, when I type ng --version, I get:
Unknown error: ReferenceError: Invalid left-hand side in assignment
Edit: I also tried this, to no effect:
npm uninstall -g angular-cli
npm cache clean or npm cache verify (if npm > 5)
npm install -g #angular/cli#latest

You can use the macOS package manager. In your terminal type:
brew install angular-cli
To confirm your version:
ng --version

I think the best way to install angular on mac is using brew.
1.) Install brew, by typing the following command on your terminal :-
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
2.) After Installing brew, then run following command :-
brew install angular-cli
After Installation, you'll see angular is successfully installed.
To check, Type Command :-
ng version

Delete npm and node, then install them via brew (works perfect on mac os).
See https://brew.sh/

Related

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.

Problems installing Vue js

I am trying to install vue.js with no success, yet npm is up to date.
When I run vue init webpack vueapp I get this error:
No command 'vue' found, did you mean:Command 'vpe' from package 'texlive-latex-extra' (universe)
vue: command not found
I have already installed the cli using npm install vue-cli.
Thanks
Try to use npm install -g #vue/cli and then vue ui to start client in your browser.
You'll want to use npm install -g #vue/cli. Restart your terminal to make sure it shows up.
Also, make sure you have node 8.9+
From the docs:
Warning regarding Previous Versions
The package name changed from vue-cli to #vue/cli. If you have the previous vue-cli (1.x or 2.x) package installed globally, you need to uninstall it first with npm uninstall vue-cli -g or yarn global remove vue-cli.
Node Version Requirement
Vue CLI requires Node.js version 8.9 or above (8.11.0+ recommended). You can manage multiple versions of Node on the same machine with nvm or nvm-windows.
For me sudo helps to solve it.
Try to use this command in terminal:
sudo yarn global add #vue/cli
Then you can check the version and all will work correctly.
vue --version
Have you installed view?
Can you check vue --version
https://cli.vuejs.org/guide/installation.html
Try to use sudo npm install -g #vue/cli instead of npm install -g #vue/cli
You need to use sudo.
The vue-cli documentation at https://cli.vuejs.org/guide/installation.html states that:
To install the new package, use one of the following commands. You
need administrator privileges to execute these unless npm was
installed on your system through a Node.js version manager (e.g. n or
nvm).
npm install -g #vue/cli
# OR
yarn global add #vue/cli
Just run npm install -g pnpm for the missing packages.
Then you can run npm install -g #vue/cli
Now you can ckeck the vue --version
sudo npm install -g #aws-amplify/cli --unsafe-perm=true
It works for my situation.

Unable to run npm on mac terminal

I have previously installed node and I can see I have version v4.2.2 on my mac when running node -v. I'm now trying to update to latest version of node as well as install grommet.js
When enter on terminal:
npm install npm#latest -g
or
npm install -g grommet-cli
I get
-bash: npm: command not found
I tried resolving with steps in link below without success:
Upgrade NodeJS to the latest version on Mac os
How should I go about resolving this one?
It's likely that npm might be broken on your system. Might want to try and reinstall npm.
curl -L https://www.npmjs.org/install.sh | sh
See https://github.com/npm/npm/wiki/Troubleshooting for additional info.

Start with fresh copy of node, npm and cordova

I had a makeshift setup on Lubuntu that 'functioned' with sudo npm install. I used Ionic Framework generator to create projects and they functioned as well as the builds and deployment.
I upgraded to 15.04 and ever since had problems finding a solution that worked does not give EACCESS errors or grunt serve telling me
Upgrade warning - for the CLI to run correctly,
it is highly suggested to upgrade the following:
Please update your Node runtime to version >=0.12.x
Please update your Cordova CLI to version >=4.2.0 npm install -g cordova
then for npm install -g cordova to tell me
npm WARN engine cordova-serve#0.1.3: wanted: {"node":">= 0.12.0","npm":">= 2.5.1"} (current: {"node":"0.10.26","npm":"2.12.1"})
I have tried the "chown -R whoami /dir/of/npm"
I have delete npm, node install brew and created new installs for all.
I still get EACCESS errors, my yo ionic "grunt serve" deploys the browser but gives ERR_CONNECTION_REFUSED
I installed brew, manually deleted the npm folder and did a clean install. No joy
which node - /home/username/.nvm/v0.10.26/bin/node
node -v v0.10.26
which npm - /home/userna/.linuxbrew/bin/npm
npm -v 2.12.1
which cordova - /usr/local/bin/cordova
cordova -v 3.5.0-0.2.6
And for good meassure i thought if i installed node4 all my troubles would disappear.
I know i messed this up but i would like a clean start with node, npm(without sudo) and cordova. Any help would be appreciated
Ps: I have done most of the normal suggestions hence my question.
Did you installed node using nvm?
So try
nvm use 4.0.0
In general:
nvm install [VERSION]
nvm use [VERSION]
To use permanent:
nvm alias default [VERSION]
try also to install cordova again after updating node
npm install -g cordova
If all fails:
Uninstall node and reinstall propper using brew:
cd ~
sudo rm -rf .npm
brew update
brew uninstall npm
brew install npm

phonegap - nothing happend on npm install -g phonegap

I've been trying to install phonegap with no luck.
I've already installed nodejs using:
sudo apt-get install node
But when I tried to run the following, nothing was outputted to the terminal. See attached image.
sudo npm install -g phonegap
Package name should be "nodejs" not "node".
Also make sure npm is installed by typing :
npm -v
in terminal.
Please read Installing Node.js via package manager for Node.js & NPM installation.

Resources