简体   繁体   English

使用 Yarn 在 vscode 中设置 NextJs

[英]NextJs setup in vscode using Yarn

I ran yarn create next-app --typescript to create a TypeScript Next app using Yarn.我运行yarn create next-app --typescript以使用 Yarn 创建一个 TypeScript Next 应用程序。 The app runs fine using yarn run dev ;该应用程序使用yarn run dev运行良好; however, vscode does not read any of the yarn packages added.但是,vscode 不会读取任何添加的纱线包。 编辑器视图 I've tried following the instructions on the official Yarn's Editor SDKs article by running:我尝试按照官方Yarn 的编辑器 SDK文章中的说明运行:

yarn dlx @yarnpkg/sdks vscode

执行日志 then selecting the TypeScript Version.然后选择 TypeScript 版本。

Same issue but i found solution https://stackoverflow.com/a/73001522/2991626同样的问题,但我找到了解决方案https://stackoverflow.com/a/73001522/2991626

just create .yarnrc.yml and add 1 line content nodeLinker: node-modules then just type command yarn and vscode will works with yarn只需创建.yarnrc.yml并添加 1 行内容nodeLinker: node-modules然后只需键入命令yarn ,vscode 将与 yarn 一起使用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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