Cannot Install Npx - node.js

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.

Related

Parcel not being intalled

I am trying to add parcel bundler to my machine.
Here is the list of commands that I have tried in order.
npm cache clean -f
npm install npm#latest -g
npm install -g parcel-bundler
Parcel then appears to have installed correctly, but it does not.
RELATED QUESTION: Cannot run parcel command
When I try and run
parcel --version
I get this
bash: parcel: command not found
Here are all the versions I am running on my machine
parcel-bundler version 1.12.3
npm version 6.4.1
node version v10.11.0 updated to v11.12.0 which also does not work
try to use
npm parcel --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.

Install angular on mac

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/

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

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

Resources