How to install angular-cli for Windows 7

I am trying to set angular-cli for windows. I know that the npm install -g angular-cli command, however, as soon as I run this command, I will then try to make ng new, but I get an error: "ng is not a recognized command." I checked other questions here, saying that you need to add the folder to the PATH variable, however, when I check the folder in which I tried to install angular-cli, I don’t even see anything.

Here you can see that I installed angular-cli using the provided command and that any use of the commands and errors of the "ng" command:

x

Here you can see an empty folder without angular-cli folders or something like that:

And here you can see an empty folder with no angular-cli folders or anything for that matter

PLEASE NOTE I am very new to cmd and angular, and I really don't know what steps to take here.

+12
source share
7 answers

Install NodeJs, npm, TypeScript, AngularJS, @ angular / cli on Windows 7 Professional SP 1 64-bit:

Since I found a lot of valuable hints scattered around various posts after a "painful" search here is a compact compilation (not my ideas, but my experience). Hope this helps.

  • install Node.js Windows Installer 64-bit: https://nodejs.org/en/download/ node -v6.11.0-x64.msi

  • If there is a (company-) proxy (installation behind the firewall): configure npm against the company proxy: open the cmd window (do not upgrade, usually you should be a login user)

    npm config set proxy http://Proxy.Company.com:Port (replace Proxy.Company.com: Port the proxy settings)

    npm config set https-proxy http://Proxy.Company.com:Port (replace Proxy.Company.com: Port your proxy settings)

    Tips: Both options are required; ask your administrators for the correct URL. If you need to deploy a user / password, use the following syntax:

    npm config set proxy http: // user: pass@Proxy.Company.com : Port

  • Install the npm directory for packages (npm 3.10.10 comes with Node.js, but we will update it later):

    npm config set registry https://registry.npmjs.org/

  • Update npm to the latest version:

    npm install npm @latest -g

    Beware: the npm update only works with the HTTPS option (registry https://registry.npmjs.org/ ). With the HTTP setting (see below) you get a "shasum check failed".

  • Set the npm directory for packages for a non-HTTPS option:

    npm config set registry http://registry.npmjs.org/

    Reason: the https option, which is necessary to update the news itself, does'nt work for all packages, for example. @ angular / cli @ last or angular-cli or typescript @latest.

  • Install TypeScript:

    npm install -g typescript @latest

  • You can upgrade from Visual Studio 2015 to version 3 (necessary) (everything also works fine with Community Edition 3): Microsoft Visual Studio Professional 2015 Version 14.0.25422.01 Update 3 of the Microsoft.NET Framework version 4.6.01055

  • Make sure that Visual Studio extracts the actually installed packages: Tools / Options, the left tree / Projects and Solutions / External Web Tools, in the right panel, move the $ (PATH) entry to the beginning (above the $ (DevEnvDir) entries. Then close Visual Studio.

  • Install AngularJS:

    npm install angular (my version: 1.6.5)

  • Install the angular command-line tool: npm install -g @ angular / cli @latest (@ angular / cli is the new name for angular-cli)

  • Check the versions (in the cmd window, my versions are lower):

    node -v => v6.11.0

    npm -v => 5.1.0

    tsc -v => 2.4.1

    ng --version => 1.2.0 (@ angular / cli)

  • Install the optional package installer for Visual Studio (see also the "Links" section below): https://marketplace.visualstudio.com/items?itemName=MadsKristensen.PackageInstaller (... Downloads \ Package Installer v2.0.101.vsix)

If something went wrong, restart using the following steps:

  • In C: \ Users \ <User> \ AppData \ Roaming, delete the directory 'npm'
  • In the cmd window: npm cache clean or possibly: npm cache clean --force
  • run node -v6.11.0-x64.msi in recovery mode
  • continue with paragraph (2.).

References:

+16
source

The latest versions of Node.js and the Angular CLI can be configured on Windows 7 in a few simple steps:

Step 1: Download Node.js

Download the latest version of Node.js from the Nodejs download page . I downloaded Node.js for 64-bit Windows and the file name: node-v8.9.3-x64.msi

Step 2: Install Node.js for Windows.

In Windows Explorer, locate the downloaded Nodejs.msi file. Double-click the MSI file. A set of screens will appear that guide you through the installation process. This will install Node.js and Node Package Manager (NPM) on your computer.

Step 3: Verify the installation of Node.js

Enter the following commands to check the versions of Node.js and NPM

node -v npm -v 

Step 4: Set Angle CLI

Angular Command Line Interface (CLI) is the easiest way to create new Angular projects. Run the following NPM command to install the Angular CLI:

 npm install @angular/cli -g 

After this installation, you can access the CLI tool with the ng commands.

Step 5: Check Angular CLI

Enter the command:

 ng -v 

I also posted all of these steps on my blog: Setup Node.js and Angular CLI

+8
source

Test it out!

 node -v 

To find out if Node is installed, enter the above at the command prompt.

 npm -v 

To find out if npm is installed, enter the above at the command prompt. Installation @ angular / cli

 npm install @angular/cli 

To add this npm package to your local computer, enter the above at the command prompt. You will see the node_modules directory in the root directory where the package is now installed.

If you have problems installing packages, check out the helpful docs for locating npm packages locally

+2
source

Please note that NG.cmd installs normally:

 C:\Users\Administrator\AppData\Roaming\npm\ng.cmd 

... where Administrator may be the username.

+1
source

Step 1: Download Node.js

Download the latest version of Node.js from the Nodejs download page. I downloaded Node.js for 64-bit Windows and the file name: node -v 8.9.3-x64.msi

Step 2: Install Node.js for Windows.

In Windows Explorer, locate the downloaded Nodejs.msi file. Double-click the MSI file. A set of screens will appear that guide you through the installation process. This will install Node.js and Node Package Manager (NPM) on your computer.

Step 3: Verify the installation of Node.js

Enter the following commands to check the versions of Node.js and NPM

node -v npm -v

Step 4: Set Angle CLI

Angular Command Line Interface (CLI) is the easiest way to create new Angular projects. Run the following NPM command to install the Angular CLI: Step 1: Download Node.js

Download the latest version of Node.js from the Nodejs download page. I downloaded Node.js for 64-bit Windows and the file name: node -v 8.9.3-x64.msi

Step 2: Install Node.js for Windows.

In Windows Explorer, locate the downloaded Nodejs.msi file. Double-click the MSI file. A set of screens will appear that guide you through the installation process. This will install Node.js and Node Package Manager (NPM) on your computer.

Step 3: Verify the installation of Node.js

Enter the following commands to check the versions of Node.js and NPM

node -v npm -v

Step 4: Install the Angular CLI This command will install the latest version of the angular command line.

npm i -g @ angular / cli

+1
source

Use this command to install the latest version.

 npm i @angular/cli @latest 
0
source
0
source

Source: https://habr.com/ru/post/1263181/


All Articles