在 vercel 中部署我的 React 项目时出现错误

问题描述 投票:0回答:1
Running build in Washington, D.C., USA (East) – iad1
Cloning github.com/KaungKhantSoe2004/LinWorkOut (Branch: master, Commit: e584ed4)
Skipping build cache, deployment was triggered without cache.
Cloning completed: 656.11ms
Running "vercel build"
Vercel CLI 34.2.2
Running "install" command: `npm install`...
npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.
npm WARN deprecated [email protected]: Use your platform's native atob() and btoa() methods instead
npm WARN deprecated [email protected]: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated [email protected]: Use your platform's native DOMException instead
npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-methods instead.
npm WARN deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
npm WARN deprecated [email protected]: Please use @jridgewell/sourcemap-codec instead
npm WARN deprecated [email protected]: Use your platform's native performance.now() and performance.timeOrigin.
npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
npm WARN deprecated [email protected]: [email protected]
npm WARN deprecated [email protected]: This SVGO version is no longer supported. Upgrade to v2.x.x.
added 1575 packages, and audited 1576 packages in 32s
257 packages are looking for funding
  run `npm fund` for details
12 vulnerabilities (5 moderate, 7 high)
To address issues that do not require attention, run:
  npm audit fix
To address all issues (including breaking changes), run:
  npm audit fix --force
Run `npm audit` for details.
npm notice 
npm notice New minor version of npm available! 10.5.0 -> 10.8.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.8.0>
npm notice Run `npm install -g [email protected]` to update!
npm notice 
> [email protected] build
> react-scripts build
Creating an optimized production build...
One of your dependencies, babel-preset-react-app, is importing the
"@babel/plugin-proposal-private-property-in-object" package without
declaring it in its dependencies. This is currently working because
"@babel/plugin-proposal-private-property-in-object" is already in your
node_modules folder for unrelated reasons, but it may break at any time.
babel-preset-react-app is part of the create-react-app project, which
is not maintianed anymore. It is thus unlikely that this bug will
ever be fixed. Add "@babel/plugin-proposal-private-property-in-object" to
your devDependencies to work around this error. This will make this message
go away.
  
Failed to compile.
static/css/main.c0a00a2e.css from Css Minimizer plugin
Error: Unexpected '/'. Escaping special characters with \ may help.
Error: Command "npm run build" exited with 1

我要部署项目

reactjs vercel
1个回答
0
投票

可能存在未关闭的注释或某些不正确的语法,或者可能存在未正确关闭的转义特殊字符。检查你的 css 文件中是否有这些并修复它。如果仍然不起作用,请运行

npm audit fix
然后运行
npm run build
查看是否构建成功

除了上面之外,还可以做下面 -

npm install --save-dev @babel/plugin-proposal-private-property-in-object
© www.soinside.com 2019 - 2024. All rights reserved.