I am trying to learn Angular, and my knowledge is in the newbie terminal. After I installed Angular, then type ng new my-project. I get an answer ng: command not found. I saw other posts that had this problem and I uninstalled and reinstalled npm and ng.
ng new my-project
ng: command not found
The last step I took was npm install -g @ angular / cli @latest, and then the new my-project.
Then I get ng: command not found.
Thank,
I think you are working on Windows to make @jowey answer easier.
$ npm install -g @angular/cli@latest
.
, .
npm i -g @angular/cli
, git bash , , . .
, NodeJs . - , , Angular CLI sudo:
NodeJs
sudo
sudo npm install -g @angular/cli
* Windows *
NPM wiki :
C:\Program Files (x86)\nodejs C:\Users\\AppData\Roaming\npm PATH, npm, node, npm npm -g install npm @.
, path :
…;C:\<path-to-node-installation>;%appdata%\npm;…
:
, …;%appdata%\npm;C:\<path-to-node-installation>;… npm, npm ( node), Agnular CLI.
…;%appdata%\npm;C:\<path-to-node-installation>;…
( - ) npm node, CLI Angualr. path : …;C:\Users\<username>\AppData\Roaming\npm\node_modules\@angular\cli;C:\<path-to-node-installation>;%appdata%\npm;… …;%appdata%\npm\node_modules\@angular\cli;C:\<path-to-node-installation>;%appdata%\npm;… .
…;C:\Users\<username>\AppData\Roaming\npm\node_modules\@angular\cli;C:\<path-to-node-installation>;%appdata%\npm;…
…;%appdata%\npm\node_modules\@angular\cli;C:\<path-to-node-installation>;%appdata%\npm;…
mocOS: ng /usr/local/bin. , .
ln -s /usr/local/Cellar/node/10.10.0/lib/node_modules/angular-cli/bin/ng /usr/local/bin/ng
Windows, :
C:\Users\[ ]\AppData\Roaming, NPM, Angular npm install -g @angular/cli
NODE NVM .
NODENVM https://github.com/creationix/nvmNODE NVM: nvm installnpm install -g angular -cli
NODE
NVM https://github.com/creationix/nvm
NODE NVM: nvm install
npm install -g angular -cli
LINK
Mac . , .
sudo npm i -g @angular/cli
Angular , , , Angular . .
, , ng . ,
angular , , ng, .
1: "npm"
C:\Users\YourUserName\AppData\Roaming
2: "npm" Node.Js.
3: Node.JS
4: Angular CLI npm install -g @angular/cli@latest
npm install -g @angular/cli@latest
5: : ng --version ng -v
ng --version
ng -v
100%
1) rm -rf/usr/local/lib/node_modules
rm -rf/usr/local/lib/node_modules
2) brew uninstall node
brew uninstall node
3) echo prefix=~/.npm-packages >> ~/.npmrc
echo prefix=~/.npm-packages >> ~/.npmrc
4) brew install node
brew install node
5) npm install -g @angular/cli
npm install -g @angular/cli
6) export PATH="$HOME/.npm-packages/bin:$PATH"
export PATH="$HOME/.npm-packages/bin:$PATH"
, - ,
7) .
, , npm.
mkdir ~/.npm-global npm config set prefix '~/.npm-global' export PATH=~/.npm-global/bin:$PATH source ~/.profile npm install -g jshint ng --version
@angular/cli
npm, npm link @angular/cli
npm link @angular/cli
Otherwise, first install angular using npm install @angular/cliand then the npm install @angular/clilink.
npm install @angular/cli
if you have npm install the command
then bind your ng with this:
cd
alias ng=".npm-global/bin/ng"
Stay tuned for more help.
just install npm install -g @ angular / cli @latest
Source: https://habr.com/ru/post/1687083/More articles:Add a new row to a Pandas DataFrame with a specific index name - pythonЭто также нарушает закон Деметры? Или это было бы чрезмерным деформированием? - phpHow can I find classpath for Java in Visual Studio Code? - javaTransfer panning gestures to MKMapView - iosConfiguring IAM roles for Firebase access - firebaseSeaborn.countplot: account order categories? - pythonAssign a specific role (Authentication) to a Firebase Console user - firebaseHow to save a subset of a multi-data index in a new data frame? - pythonPInvoke из _wtof_l в С# быстрее, чем изначально ссылаться на С++ - c++Why do I see all the original index elements in the slice of the data? - pythonAll Articles