问题
I am new to Angular. Successfully installed Angular by Cls, but when i create project by typing "ng new projectName". It fails. gives me this
$ ng new p1
CREATE p1/angular.json (3512 bytes)
CREATE p1/package.json (1306 bytes)
CREATE p1/README.md (1019 bytes)
CREATE p1/tsconfig.json (384 bytes)
CREATE p1/tslint.json (2805 bytes)
CREATE p1/.editorconfig (245 bytes)
CREATE p1/.gitignore (503 bytes)
CREATE p1/src/environments/environment.prod.ts (51 bytes)
CREATE p1/src/environments/environment.ts (631 bytes)
CREATE p1/src/favicon.ico (5430 bytes)
CREATE p1/src/index.html (289 bytes)
CREATE p1/src/main.ts (370 bytes)
CREATE p1/src/polyfills.ts (3194 bytes)
CREATE p1/src/test.ts (642 bytes)
CREATE p1/src/assets/.gitkeep (0 bytes)
CREATE p1/src/styles.css (80 bytes)
CREATE p1/src/browserslist (375 bytes)
CREATE p1/src/karma.conf.js (964 bytes)
CREATE p1/src/tsconfig.app.json (194 bytes)
CREATE p1/src/tsconfig.spec.json (282 bytes)
CREATE p1/src/tslint.json (314 bytes)
CREATE p1/src/app/app.module.ts (314 bytes)
CREATE p1/src/app/app.component.html (1141 bytes)
CREATE p1/src/app/app.component.spec.ts (985 bytes)
CREATE p1/src/app/app.component.ts (207 bytes)
CREATE p1/src/app/app.component.css (0 bytes)
CREATE p1/e2e/protractor.conf.js (752 bytes)
CREATE p1/e2e/src/app.e2e-spec.ts (298 bytes)
CREATE p1/e2e/src/app.po.ts (208 bytes)
CREATE p1/e2e/tsconfig.e2e.json (213 bytes)
...
npm WARN deprecated istanbul-lib-hook@1.2.1: 1.2.0 should have been a major vers
ion bump
I have tried npm cache clear --force
.
Still problem persist
and then when i type "ng serve", it does not work it gives me -
"Could not find module "@angular-devkit/build-angular" from "C:\Users\Avvncor\Projects\p1". Error: Could not find module "@angular-devkit/build-angular" from "C:\Users\Avvncor\Projects\p1". "
回答1:
That is not an error, those are the files created in a new project. You shouldn't have any problems, comment if you do. Hope this helps!
来源:https://stackoverflow.com/questions/50888707/angular-creating-new-project-fail