0

This is my first Angular App (wanted to start with something easy but I couldn´t even start).

The problem is when I execute ng new [my_app_name] there are several errors and warnings:

- Installing packages...npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecatednpm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecatednpm WARN deprecated tslint@6.1.2: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.npm ERR! Unexpected end of JSON input while parsing near '...ll":"https://registry' npm ERR! A complete log of this run can be found in:npm ERR! <user_root>\AppData\Roaming\npm-cache\_logs\2020-05-20T09_36_33_420Z-debug.log × Package install failed, see above. The Schematic workflow failed. See above.

Versions: | Node: 12.16.2 | Angular CLI: 9.1.6 | Ionic: 5.4.16 | Git: 2.26.1 |

It stills creates my app folder but without node_modules folder, any ideas?

MANZARBEITIA
  • 103
  • 6

2 Answers2

1

Open your command prompt and enter the following:

npm install -g @angular/cli
ng new my-app

The first command uses npm(node package manager) to install the Angular CLI. A CLI is a command line interface, you are installing an Angular CLI in this case. This enables you to use angular commands in the command prompt. The second command is an angular command which creates an angular application, ng is a shorthand for Angular.

In order to run the application you do the following:

cd my-app
ng serve --open

The first command moves you to the my-app directory, and the second command runs the Angular application. You can read more about setting up Angular here.

Edit: Excuse me didn't read your original question that well, I read the comment you placed under Don OzOn's answer and thought you were having trouble creating an Angular application. If npm has already been installed I suggest first running npm install to try and solve the dependency warnings and then run npm init to create the package.json file. Make sure you are in your Angular project directory when running this command. This question also adresses your problem: npm install doesn't create node_modules directory

Moo
  • 48
  • 2
  • 9
0

try follow this step

1-npm install -g @angulat/cli
2-npm install mkdirp
3-npm cache verify
4-close terminal and open again
5-ng new your project name
Don OzOn
  • 156
  • 8
  • I´ve just tried with the 1st step, it throws back the following: `npm ERR! code E404 npm ERR! 404 Not Found - GET https://registry.npmjs.org/@angulat%2fcli - Not found npm ERR! 404 npm ERR! 404 '@angulat/cli@latest' is not in the npm registry. npm ERR! 404 You should bug the author to publish it (or use the name yourself!) npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, http url, or git url. npm ERR! A complete log of this run can be found in: npm ERR! \AppData\Roaming\npm-cache\_logs\2020-05-20T11_18_50_981Z-debug.log´ – MANZARBEITIA May 20 '20 at 11:19