首页 > 解决方案 > 为什么 nuxt 要求 @nuxt/typescript-build

问题描述

如何修复此错误?

WARN  Module @nuxt/typescript-build not found. Please ensure @nuxt/typescript-build 
is in devDependencies and installed. HINT: During build step, for npm/yarn, 
NODE_ENV=production or --production should NOT be used.

环境是 AWS lambda,节点 14。 Nuxt 安装有 typescript,从 npm 生成。

标签: node.jsnuxt.js

解决方案


不确定这个在做什么,但这是安装过程中所需的软件包之一。如此处所示:https ://typescript.nuxtjs.org/guide/setup#installation

yarn add --dev @nuxt/typescript-build @nuxt/types

将此添加到您的nuxt.config.js文件中

export default {
  buildModules: ['@nuxt/typescript-build']
}

创建一个tsconfig.json文件,你应该很好!


推荐阅读