Npm install issue HOMEBREW - node.js

This is the error I got:
npm install error 3097 error command sh -c node scripts/build.js 3098 error Building: /opt/homebrew/Cellar/node/16.5.0/bin/node
I just switched to Mac from Windows and cloned my repo. Tried to run npm install to install the packages for my react app and got this error.
I installed node with homebrew.

The issue seemed to be related with installing node with home brew. As a quick and easy fix I just ran brew uninstall node and then went to the nodejs website and installed it for mac manually. This took care of the issues and I was able to install my packages successfully.

Related

npm package getting installed but not working

when I am using command npm install -g lerna it gets executed with no error but after that using command
lerna --version gives output "lerna:command not found".
Possible solution
maybe if somehow I manage it to install in usr/local/lib/node_modules it should work cause other npm packages installed here are working fine but its getting installed in /home/surajkulriya/.npm-global/lib/node_modules.
OS: ubuntu 18.04
which npm:/usr/local/bin/npm
which node:/usr/local/bin/node
which nodejs:/usr/bin/nodejs
Finally after too much effort I sorted out the issue. I removed node nodejs and npm completely and reinstalled them again and used command
npm i -g npm
to fix the broken dependecies.I reinstalled lerna and it worked.

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.

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/

reinstalled npm - now npm works only with sudo (osx high sierra)

I was unable to install electron in my system (was getting postinstall error). So I thought let me uninstall and reinstall node and npm. I tried this gist and couldnt install npm - that erred out. So I went to node js website and downloaded versions: node 8.9.0 & npm 5.6.0. While I now have node and npm back, no npm installation works without a sudo. Funny thing, I get the same electron installation error. I tried fixing the sudo problem using this link but no help. Please advise!
Screenshot of the npm error:
Screenshot of the electron installation error:

Cannot install npm modules (packages) in Windows 7?

I have node js (version 5.6.0) and npm(version 3.6.0) installed on my PC.But the problem is I am not able to install npm packages on my PC.Whenever I run npm install "somepackage" from the Cmd line, it shows "LoadDep:unorm-> get" something like this and installation stops.How can I install Npm packages?
Thanks in advance :)

Resources