惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
MongoDB | Blog
MongoDB | Blog
Google DeepMind News
Google DeepMind News
M
MIT News - Artificial intelligence
D
Docker
云风的 BLOG
云风的 BLOG
B
Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
G
Google Developers Blog
GbyAI
GbyAI
T
Tailwind CSS Blog
罗磊的独立博客
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
C
Check Point Blog
I
InfoQ
Microsoft Azure Blog
Microsoft Azure Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
阮一峰的网络日志
阮一峰的网络日志
小众软件
小众软件
N
Netflix TechBlog - Medium
B
Blog RSS Feed
腾讯CDC
aimingoo的专栏
aimingoo的专栏

博客园 - sekihin

【SQLSERVER】备份还原除当前数据库~之外的其他数据库的bak备份 【前端】常用VsCode插件 React席哪个能优化 20 GitHub 仓库帮助你成为 React专家 Export a named export for each HTTP method instead.(Next.js 15) Error occurred prerendering page "/_not-found".(Next.js 15) Error: Attempted to call generateViewport() from the server (Next.js 15) [cause]: TypeError: e_.createContext is not a function (Next.js 15) Cursor - AI代码编辑器的使用指南 Next.js项目中.prettierrc.json的配置 Next.js项目中.eslintrc.js的配置 nvm: Node Version Manager PHP slim 部署Apache NestJS 部署Apache NestJS导出API文档 ChatGPT plugins Obisidian plugins Build nest.js by tsconfig.json Data Transfer Objects (DTOs) in NestJS
TypeError: stringWidth is not a function
sekihin · 2024-12-10 · via 博客园 - sekihin

 node_modules\cli-table3\src\utils.js:12

This is still related to the Node.js v22 compatibility issues, but now specifically with @nestjs/cli. Let's try a complete solution:

  • First, clean your project:
    rm -rf node_modules
    rm yarn.lock
  • Update your package.json with these resolutions:
    {
      // ... other configs ...
      "resolutions": {
        "string-width": "4.2.3",
        "strip-ansi": "6.0.1",
        "cli-table3": "0.6.3",
        "@nestjs/cli": "10.3.2"
      }
    }
  • Install dependencies again:
  • If the issue persists, the most reliable solution is to downgrade Node.js: 
    nvm install 18.19.1
    nvm use 18.19.1


    Then clean and reinstall: 

    rm -rf node_modules
    rm yarn.lock
    yarn install

        The root cause is that NestJS CLI and its dependencies aren't fully compatible with Node.js v22 yet. Using Node.js 18 LTS is currently the most stable solution for NestJS projects. Node.js 18 is the recommended version for NestJS development and has long-term support until April 2025.

posted @ 2024-12-10 11:55  sekihin  阅读(350)  评论(0)    收藏  举报