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

后端 未结 30 2842
忘掉有多难
忘掉有多难 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:00

    Make sure that the npm directory is in your "Path" variable.

    If the module is installed properly, it may work if you start it out of your global node module directory, but your command line tool doesn't know where to find the ng command when you are not in this directory.

    For Win system variable add something like:

    %USERPROFILE%\AppData\Roaming\npm
    

    And if you use a unix-like terminal (emulator):

    PATH=$PATH:[path_to_your_user_profile]/path-to-npm
    

提交回复
热议问题