当前位置:首页 » 《随便一记》 » 正文

nest.js创建以及error相关问题

3 人参与  2022年11月18日 19:03  分类 : 《随便一记》  评论

点击全文阅读


开始之前,你可以使用 Nest CLI 创建项目,也可以克隆一个 starter project(两者的结果是一样的)。

若要使用 Nest CLI 构建项目,请运行以下命令。这将创建一个新的项目目录,并使用核心的 Nest 文件和支撑模块填充该目录,从而为项目创建一个传统的基本结构。建议初学者使用 Nest CLI 创建新项目。我们将 第一步 章节中继续采用这种方法。

$ npm i -g @nestjs/cli
$ nest new project-name

选择要创建的目录:

例如你要创建的目录是D盘,那就是D:

创建一个目录 例如nest

D:\>cd nest

nest new nestdemo1

开始创建

如果创建失败!报错

Error: EPERM: operation not permitted, mkdir 'D:\nest\nestdemo1'

Failed to execute command: node @nestjs/schematics:application --name=nestdemo1 --directory=undefined --no-dry-run --no-skip-git --no-strict --package-manager=undefined --collection="@nestjs/schematics" --language="ts"

请下载npm i -g @nestjs/schematics

就会发现下载成功

npm WARN @nestjs/schematics@9.0.3 requires a peer of typescript@^4.3.5 but none is installed. You must install peer dependencies yourself.

+ @nestjs/schematics@9.0.3
added 53 packages from 84 contributors in 21.302s

如果继续创建显示

Error: EPERM: operation not permitted, mkdir 'D:\nest\demo1'

Failed to execute command: node @nestjs/schematics:application --name=demo1 --directory=undefined --no-dry-run --no-skip-git --no-strict --package-manager=undefined --collection="@nestjs/schematics" --language="ts"

那就是管理员控制台原因

直接再windows用管理员权限打开控制台进行创建

D:\>cd nest

D:\nest>nest new demo1
⚡  We will scaffold your app in a few seconds..

CREATE demo1/.eslintrc.js (665 bytes)
CREATE demo1/.prettierrc (51 bytes)
CREATE demo1/nest-cli.json (118 bytes)
CREATE demo1/package.json (1990 bytes)
CREATE demo1/README.md (3340 bytes)
CREATE demo1/tsconfig.build.json (97 bytes)
CREATE demo1/tsconfig.json (546 bytes)
CREATE demo1/src/app.controller.spec.ts (617 bytes)
CREATE demo1/src/app.controller.ts (274 bytes)
CREATE demo1/src/app.module.ts (249 bytes)
CREATE demo1/src/app.service.ts (142 bytes)
CREATE demo1/src/main.ts (208 bytes)
CREATE demo1/test/app.e2e-spec.ts (630 bytes)
CREATE demo1/test/jest-e2e.json (183 bytes)

? Which package manager would you ❤️  to use? (Use arrow keys)
> npm
  yarn
  pnpm

完事

让你使用一个创建的命令,懂得都懂了吧

 


点击全文阅读


本文链接:http://m.zhangshiyu.com/post/48903.html

<< 上一篇 下一篇 >>

  • 评论(0)
  • 赞助本站

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

最新文章

  • 苔藓爬满旧日诺言全书+后续+结局顾砚廷慕晚夏免费苔藓爬满旧日诺言全书+后续+结局顾砚廷慕晚夏全书全
  • [我掉蛇女马甲后,点天灯假死丈夫悔疯了]免费试读_婆婆丁若菱蛇女精彩节选推荐
  • 他日若是同淋雪结局+番外(夏尔若林闻舟)他日若是同淋雪结局+番外结局_夏尔若林闻舟列表_笔趣阁(他日若是同淋雪结局+番外)
  • 他心非石反转剧情试读片段_安茗宝宝心掏后续更新+番外
  • 许星森纪冰雪(日暮青山绿渐隐许星森纪冰雪结局+番外)_(许星森纪冰雪)列表_笔趣阁(日暮青山绿渐隐许星森纪冰雪结局+番外)
  • 全文潮痕蚀月光(池清禾***宸)列表_全文潮痕蚀月光
  • 「江月随人处处圆」小说无删减版在线免费阅读_[陆晨小姐孟苒]精彩章节免费试读
  • 阮雾梨闻砚辞阮见微结局+番外全书+后续+结局(闻砚辞阮雾梨)列表_阮雾梨闻砚辞阮见微结局+番外(闻砚辞阮雾梨)阮雾梨闻砚辞阮见微结局+番外全书+后续+结局在线
  • 潮痕蚀月光结局+番外池清禾***宸(潮痕蚀月光结局+番外)全书免费池清禾***宸_潮痕蚀月光结局+番外池清禾***宸列表_笔趣阁(池清禾***宸)
  • 苔藓爬满旧日诺言一口气读完全书+后续全书+后续+结局(慕晚夏顾砚廷)列表_苔藓爬满旧日诺言一口气读完全书+后续(慕晚夏顾砚廷)苔藓爬满旧日诺言一口气读完全书+后续全书+后续+结局在线
  • 「孕弟」反转剧情碎片化试读_[耀祖弟弟子宫]小说精彩节选试读
  • 旧梦随风去结局+番外(姜予宁沈昭寒)列表_旧梦随风去结局+番外(姜予宁沈昭寒)全书+后续+结局在线

    关于我们 | 我要投稿 | 免责申明

    Copyright © 2020-2022 ZhangShiYu.com Rights Reserved.豫ICP备2022013469号-1