I am learning Next.js by following: https://nextjs.org/learn/basics/deploying-nextjs-app/setup
My package.json file looks normal:
{
"name": "paths",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@types/node": "18.11.11",
"@types/react": "18.0.26",
"@types/react-dom": "18.0.9",
"eslint": "8.29.0",
"eslint-config-next": "13.0.6",
"next": "13.0.6",
"react": "18.2.0",
"react-dom": "18.2.0",
"typescript": "4.9.3"
}
}
My package-lock.json file is a 217KB file (5300 lines). The problem is that some of those dependencies/versions exist on another server. When I try to deploy on Vercel, I think it can't find/access those dependencies.
I'm trying to figure out what the best way forward is. It seems like I can:
- not create it with package-lock=false and/or
- not upload package-lock.json to git.
Are those my only options?
1条答案
按热度按时间iyr7buue1#
如果你认为
package-lock.json
有什么奇怪的地方,而package.json
是正确的,只需删除package-lock.json
和node_modules
,然后用npm i
重新创建它们。如果你得到一个类似的
package-lock.json
,那么这个文件的内容是准确的。如果你认为它有太多的依赖项,这意味着你的依赖项本身有很多依赖项。Next是出了名的笨重。