我已经试着调试这个错误很久了.Vercel截图我的根目录中有一个.env文件。我对web部署完全陌生,所以我也不太清楚应该在.env文件中放什么。Vercel的错误消息指向/vercel/path0/node_modules/next-sitemap/bin/next-sitemap的目录甚至不是这个项目根目录中的目录。
编辑:这是项目的文件结构。文件结构
EDIT2: package.json文件
"name": "landing-page",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build && next export",
"postbuild": "next-sitemap"
},
"dependencies": {
"@next/bundle-analyzer": "^12.0.7",
"dotenv": "^8.6.0",
"file-loader": "^6.2.0",
"framer-motion": "^2.7.5",
"globby": "^11.0.0",
"isomorphic-unfetch": "^3.0.0",
"next": "9.5.3",
"next-compose-plugins": "^2.2.0",
"next-optimized-images": "^2.5.4",
"npm": "^8.2.0",
"prettier": "^2.1.2",
"rc-drawer": "^4.1.0",
"react": "16.13.0",
"react-custom-scrollbars": "^4.2.1",
"react-dom": "16.13.0",
"react-ga": "^3.1.2",
"react-icons": "^3.10.0",
"react-modal-video": "^1.2.6",
"react-multi-carousel": "^2.5.5",
"react-scroll": "^1.8.0",
"react-stickynode": "^3.0.3",
"theme-ui": "^0.3.1",
"typeface-dm-sans": "^1.1.3",
"webpack": "^4.46.0"
},
"devDependencies": {
"imagemin-mozjpeg": "^9.0.0",
"imagemin-optipng": "^8.0.0",
"imagemin-svgo": "^8.0.0",
"next-sitemap": "^1.6.203",
"webpack-cli": "^4.9.1"
}
}发布于 2021-12-08 18:10:03
您的项目没有package-lock.json文件。这很可能导致error。
node_modules目录。下面是一个项目应该是什么样子的例子。

npm install。package-lock.json文件放在根目录中。deploy你的应用程序,没有任何问题。https://stackoverflow.com/questions/70271985
复制相似问题