ng: command not found while creating new project using angular-cli

后端 未结 30 2916
忘掉有多难
忘掉有多难 2020-11-28 23:42

Installed angular-cli globally using (npm install -g angular-cli) but when I\'m trying to create project using ng new my-project it is throwing err

30条回答
  •  难免孤独
    2020-11-29 00:15

    If you have a MacOS computer (mine is MOJAVE 10.14.2), just add these lines to the end of your ~/.bash_profile file:

    export ANGULAR=~/.nvm/versions/node/v10.8.0/bin/ng
    export PATH=$ANGULAR:$PATH
    

    Notice that v10.8.0 is the version of my installed Node.js. To get which version is yours, run this:

    node --version
    

    When done, reload it via your terminal/bash:

    cd ~
    source .bash_profile
    

    After doing these steps you should be able to run your ng binary file.

提交回复
热议问题