【发布时间】:2021-07-01 19:19:41
【问题描述】:
我正在使用 Nextjs 和 Vercel 来部署我的网站。赛普拉斯昨天工作正常。但是今天当 Vercel 运行构建时,我收到以下错误:
我注意到 vercel 正在安装 Cypress 版本 6.9.0,而我的 package.json 文件中有 6.8.0。
所以我更新到 6.9.0 版本,但我仍然得到同样的错误。为什么会突然出现这种情况?
我的package.json 文件
{
"name": "website",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "cross-env API_URL=http://localhost:1337 next dev",
"public-dev": "next dev",
"build": "next build",
"start": "next start",
"cypress:open": "cypress open"
},
"dependencies": {
"@apollo/client": "^3.1.3",
"@blueprintjs/core": "^3.35.0",
"@blueprintjs/datetime": "^3.19.3",
"@popperjs/core": "^2.5.4",
"axios": "^0.21.1",
"graphql": "^15.3.0",
"graphql-tag": "^2.10.4",
"isomorphic-unfetch": "^3.1.0",
"moment": "^2.29.1",
"next": "10.0.2",
"next-with-apollo": "^5.1.0",
"nouislider-react": "^3.3.8",
"react": "^17.0.1",
"react-copy-to-clipboard": "^5.0.2",
"react-dom": "^17.0.1",
"react-flatpickr": "^3.10.6",
"react-froala-wysiwyg": "^3.2.1",
"react-ga": "^3.2.1",
"react-gtm-module": "^2.0.11",
"react-localization": "^1.0.15",
"react-lottie": "^1.2.3",
"react-popper": "^2.2.3",
"react-scroll": "^1.8.1",
"react-slick": "^0.27.13",
"sass": "^1.30.0",
"swiper": "^6.3.5",
"swr": "^0.4.2"
},
"devDependencies": {
"@types/node": "^14.0.27",
"@types/react": "^16.9.46",
"cross-env": "^7.0.2",
"cypress": "^6.9.0",
"cypress-localstorage-commands": "^1.4.2",
"eslint": "^7.4.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-standard": "^4.0.1",
"typescript": "^3.9.7"
}
}
【问题讨论】:
-
您的包文件中有
^6.8.0,这意味着 6.8.0 6.9.0。但是您应该只在生产环境中运行npm install,使用npm ci,以便使用锁定文件并获得一致的构建。 -
每次推送都会出现这种情况吗?还是只在一个版本上?
-
@leerob 昨天我每次推送都会发生这种情况,但今天赛普拉斯团队删除了 6.9.0,所以现在一切都很好。明天当 stackoverflow 允许时,我将在下面接受我的答案。
标签: reactjs npm next.js cypress vercel