简体   繁体   中英

Confused by Node.js installation to use Angular.js

I'm going through the tutorial provided by Angular( https://docs.angularjs.org/tutorial ) but I'm confused by the Node.js installation. I already have node installed globally on my mac. In the tutorial it states:

The tutorial instructions, from now on, assume you are running all commands from within the angular-phonecat directory.

Is the tutorial assuming that I do not have Node.js installed on my local machine? Or are these instructions for installing Node.js into my project folder? https://docs.angularjs.org/tutorial#install-node-js

When I run the command:

node --version

I get the result:

v7.4.0

And I get that result running the command in a new terminal as well.

The tutorial assumes that node is installed but you are running any commands from inside the angular-phonecat directory.

ie in a terminal you should cd to the angular-phonecat directory and run whatever commands are instructed.

cd /path/to/angular-phonecat
node start

It sounds like your set up is fine but you should verify you are running a compatible version of NodeJS.

You have node installed correctly already.

The bit about being in the angular-phonecat directly is just making sure you are in the directory where the package.json file is. When you run say npm install it will look in your current directory for a package.json file. So the demo just wants to make sure when they tell you to run commands that you are in the right directory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM