English 中文(简体)
Vercel在部署下游项目时不承认打字或@型号/反应。
原标题:Vercel not recognizing typescript or @types/react when deploying Next.js Project

All of a sudden, my Next.js deployment to Vercel stopped working after the latest deploy and started complaining about not having @types/react AND typescript installed.

It looks like you re trying to use TypeScript but do not have the required package(s) installed.
Please install typescript and @types/react by running:

    npm install --save-dev typescript @types/react

If you are not trying to use TypeScript, please remove the tsconfig.json file from your package root (and any TypeScript files in your pages directory).

在我的项目中,我使用了:

  "@types/react": "18.2.15",
  "typescript": "5.1.6"

在部署失败时,我根本不修改这些一揽子计划。 我对受扶养人所作的唯一变化是增加了che。 我尝试重建这一揽子方案。 也没有消除这一错误。

我来到这里的有,几乎同一问题。 然而,由于这个问题已经过时,我决定在2023年提出一个新问题。 旧的解决办法是贬低“@型号/反应型号”,但对我来说并不可行。

How can I get past this blocker? Thanks

问题回答

问题是,我正在把NODE_ENV秘密定为生产。 在删除之后,我的问题已经解决。 我不知道下一份联合材料将在建造时自动确定这一秘密。

如果用户不像我那样偶然地把它放在一起,那么就不应该错了。 或者至少犯了一个有益的错误。 但是,我的解决办法是将NODE_ENV秘密从Vercel环境变量中删除。





相关问题
How to make Sequelize use singular table names

I have an model called User but Sequelize looks for the table USERS whenever I am trying to save in the DB. Does anyone know how to set Sequelize to use singular table names? Thanks.

What is Node.js? [closed]

I don t fully get what Node.js is all about. Maybe it s because I am mainly a web based business application developer. What is it and what is the use of it? My understanding so far is that: The ...

Clientside going serverside with node.js

I`ve been looking for a serverside language for some time, and python got my attention somewhat. But as I already know and love javascript, I now want learn to code on the server with js and node.js. ...

Can I use jQuery with Node.js?

Is it possible to use jQuery selectors/DOM manipulation on the server-side using Node.js?

How do I escape a string for a shell command in node?

In nodejs, the only way to execute external commands is via sys.exec(cmd). I d like to call an external command and give it data via stdin. In nodejs there does yet not appear to be a way to open a ...

热门标签