当我将Next项目推送到GitHub时,出现以下错误: 您定义了1个与任何源文件都不匹配的内部版本(请确保未在.nowignore中定义它们) 这就是我的now.json的样子:
`
{
"version": 2,
"builds": [
{
"src": "packages/web-app/package.json",
"use": "@now/next"
}
],
"build": {
"env": {
"SECRET": "dev-key",
"ANOTHER_SECRET": "another-dev-key"
}
}
}
`
根文件夹中的和Package.json文件包含以下内容:
`
{
"name": "biletiniz",
"private": true,
"workspaces": [
"packages/*"
],
"scripts": {
"bootstrap": "lerna bootstrap",
"dev": "lerna bootstrap && lerna run dev",
"build": "lerna bootstrap && lerna run build",
"start": "lerna bootstrap && lerna run start"
},
"dependencies": {
"lerna": "^3.16.4"
},
"version": "1.0.0",
"author": "LamaDabbeet",
"license": "MIT"
}
答案 0 :(得分:1)
在Now.js V2中尝试一下:
{
"version": 2,
"name": "awesome-app",
"builds": [
{
"src": "packages/next-app/package.json",
"use": "@now/next"
}
],
"routes": [
{
"src": "/(.*)",
"dest": "/packages/next-app/$1",
"headers": {
"x-request-path": "$1"
}
}
],
"env": {
"SECRET": "dev-key",
"ANOTHER_SECRET": "another-dev-key"
}
}
next-app
是您的next.js应用程序包