我正在用下面的package.json编写下一个项目。
{
"name": "dapp-boilerplate",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"format": "prettier --write . --ignore-path .gitignore ./next-env.d.ts",
"typechain": "typechain --target ethers-v5 --out-dir ./contracts/types './contracts/*.json'"
},
"dependencies": {
"@types/": "metamask/providers",
"@types/eslint": "^8.4.8",
"next": "^12.3.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@next/eslint-plugin-next": "^13.0.0",
"@typechain/ethers-v5": "^10.1.0",
"@types/node": "^18.11.5",
"@types/react": "^18.0.22",
"@typescript-eslint/eslint-plugin": "^5.41.0",
"@typescript-eslint/parser": "^5.41.0",
"eslint": "^8.26.0",
"eslint-config-next": "^13.0.0",
"eslint-config-prettier": "^8.5.0",
"ethers": "^5.0.31",
"prettier": "2.7.1",
"typechain": "^8.1.0",
"typescript": "^4.1.3"
}
}我对yarn build有这样的意见。我以为这是因为隐晦,但这不是正确的原因。有人能解决这个问题吗?
yarn run v1.22.19
$ next build
info - Linting and checking validity of types .Failed to compile.
Type error: Cannot find type definition file for '@babel'.
The file is in the program because:
Entry point for implicit type library '@babel'
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.我试图部署到netlify,得到了意想不到的错误,所以我运行了yarn build,然后得到了错误。
发布于 2022-10-26 05:46:28
安装babel的类型定义文件如下:
npm i --save-dev @types/babelhttps://stackoverflow.com/questions/74203139
复制相似问题