无法使用npm作为packagemanager创建新的角度项目

时间:2019-12-05 23:49:24

标签: angular

我无法创建新的Angular项目。我已将packagemanager设置为npm。 npm config set注册表仍位于https://registry.npmjs.org/上,它不起作用:

C:\Angular>ng new project1
? Would you like to add Angular routing? No
? Which stylesheet format would you like to use? CSS
CREATE project1/angular.json (3609 bytes)
CREATE project1/package.json (1294 bytes)
CREATE project1/README.md (1026 bytes)
CREATE project1/tsconfig.json (543 bytes)
CREATE project1/tslint.json (1953 bytes)
CREATE project1/.editorconfig (246 bytes)
CREATE project1/.gitignore (631 bytes)
CREATE project1/browserslist (429 bytes)
CREATE project1/karma.conf.js (1020 bytes)
CREATE project1/tsconfig.app.json (270 bytes)
CREATE project1/tsconfig.spec.json (270 bytes)
CREATE project1/src/favicon.ico (948 bytes)
CREATE project1/src/index.html (294 bytes)
CREATE project1/src/main.ts (372 bytes)
CREATE project1/src/polyfills.ts (2838 bytes)
CREATE project1/src/styles.css (80 bytes)
CREATE project1/src/test.ts (642 bytes)
CREATE project1/src/assets/.gitkeep (0 bytes)
CREATE project1/src/environments/environment.prod.ts (51 bytes)
CREATE project1/src/environments/environment.ts (662 bytes)
CREATE project1/src/app/app.module.ts (314 bytes)
CREATE project1/src/app/app.component.html (25498 bytes)
CREATE project1/src/app/app.component.spec.ts (987 bytes)
CREATE project1/src/app/app.component.ts (212 bytes)
CREATE project1/src/app/app.component.css (0 bytes)
CREATE project1/e2e/protractor.conf.js (808 bytes)
CREATE project1/e2e/tsconfig.json (214 bytes)
CREATE project1/e2e/src/app.e2e-spec.ts (641 bytes)
CREATE project1/e2e/src/app.po.ts (262 bytes)
'yarn' is not recognized as an internal or external command,
operable program or batch file.
Package install failed, see above.

1 个答案:

答案 0 :(得分:0)

尝试npm cache clean,然后再次执行新命令

npm cache clean

似乎已经创建了与项目相关的文件,并且还创建了package.json,您可以像下面这样

npm i

上面的命令将再次安装/添加与angular相关的项目库,您将从项目开始