{"id":959,"date":"2021-03-19T13:25:36","date_gmt":"2021-03-19T12:25:36","guid":{"rendered":"https:\/\/nguenkam.com\/blog\/?p=959"},"modified":"2022-06-08T17:56:44","modified_gmt":"2022-06-08T15:56:44","slug":"angular-ng-command-not-found-bug","status":"publish","type":"post","link":"https:\/\/nguenkam.com\/blog\/index.php\/2021\/03\/19\/angular-ng-command-not-found-bug\/","title":{"rendered":"Angular &#8211; ng: command not found (Bug)"},"content":{"rendered":"\n<p><strong>case-study :<\/strong>  Installed angular-cli globally using (<code>npm install -g angular-cli<\/code>) but when  trying to create project using&nbsp;<code>ng new my-project<\/code>&nbsp;it is throwing error:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p><\/p><cite>ng: command not found<\/cite><\/blockquote>\n\n\n\n<p><\/p>\n\n\n\n<p>The issue is simple,&nbsp;<code>npm<\/code>&nbsp;doesn&#8217;t know about&nbsp;<code>ng<\/code><\/p>\n\n\n\n<p>Just run&nbsp;<code>npm link @angular\/cli<\/code>&nbsp;and it should work seamlessly.<\/p>\n\n\n\n<p>otherwise:  we will have to rearrange  (manualy) the PATHS to:<\/p>\n\n\n\n<ul><li>NPM<\/li><li>Nodejs<\/li><li>Angular CLI<\/li><\/ul>\n\n\n\n<p>In System Environment Variables, the picture below shows the arrangement.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-rich is-provider-imgur wp-block-embed-imgur\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"imgur-embed-pub\" lang=\"en\" data-id=\"9l6FI\"><a href=\"https:\/\/imgur.com\/9l6FI\">View post on imgur.com<\/a><\/blockquote><script async src=\"\/\/s.imgur.com\/min\/embed.js\" charset=\"utf-8\"><\/script>\n<\/div><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Then restart your system, and try the command again. It should work fine now \ud83d\ude42<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h4><span class=\"has-inline-color has-vivid-red-color\">How to set global environment variables on Windows<\/span> <span class=\"has-inline-color has-vivid-red-color\">?<\/span><\/h4>\n\n\n\n<p><strong>Windows 7, 8,10<\/strong><\/p>\n\n\n\n<ol><li>Right click the Computer icon on your desktop and choose Properties from the menu.<\/li><li>Click on the Advanced system settings link and then click Environment Variables. Under the section System Variables, select the environment variable you want to edit, and click Edit.<\/li><li>If the environment variable you want doesn&#8217;t exist, click New.<\/li><li>Input the value of the environment variable in the Edit System Variable (or New System Variable) window, and click OK.<\/li><\/ol>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>case-study : Installed angular-cli globally using (npm install -g angular-cli) but when trying to create project using&nbsp;ng new my-project&nbsp;it is throwing error: ng: command not found The issue is simple,&nbsp;npm&nbsp;doesn&#8217;t know about&nbsp;ng Just run&nbsp;npm link @angular\/cli&nbsp;and it should work seamlessly. otherwise: we will have to rearrange (manualy) the PATHS to: NPM Nodejs Angular CLI In [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1965,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1,37],"tags":[40,172,247,140],"_links":{"self":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/959"}],"collection":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=959"}],"version-history":[{"count":4,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/959\/revisions"}],"predecessor-version":[{"id":1972,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/959\/revisions\/1972"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/media\/1965"}],"wp:attachment":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=959"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=959"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=959"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}