node.js - 在heroku中部署我的项目。我的应用程序在本地运行良好,但在部署时它崩溃了
问题描述
enter code here
**
**
C:\Users\My PC\Desktop\cloth-app>git push heroku master
Enumerating objects: 37595, done.
Counting objects: 100% (37595/37595), done.
Delta compression using up to 4 threads
Compressing objects: 100% (27459/27459), done.
Writing objects: 100% (37595/37595), 50.79 MiB | 86.00 KiB/s, done.
Total 37595 (delta 8403), reused 37580 (delta 8397), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> React.js (create-react-app) multi app detected
remote: =====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-multi.git
remote: =====> Detected Framework: Multipack
remote: =====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-nodejs.git
remote: =====> Detected Framework: Node.js
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote: NODE_VERBOSE=false
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): 12.18.1
remote: engines.npm (package.json): 6.14.5
remote:
remote: Resolving node version 12.18.1...
remote: Downloading and installing node 12.18.1...
remote: npm 6.14.5 already installed with node
remote:
remote: -----> Installing dependencies
remote: Installing node modules
remote:
remote: > nodemon@2.0.6 postinstall /tmp/build_5f5304d1/node_modules/nodemon
remote: > node bin/postinstall || exit 0
remote:
remote: Love nodemon? You can now support the project via the open collective:
remote: > https://opencollective.com/nodemon/donate
remote:
remote: added 268 packages in 5.208s
remote:
remote: -----> Build
remote: Detected both "build" and "heroku-postbuild" scripts
remote: Running heroku-postbuild
remote:
remote: > cloth-app-server@1.0.0 heroku-postbuild /tmp/build_5f5304d1
remote: > cd client && npm install && npm install --only=dev --no-shrinkwrap && npm run build
remote:
remote: audited 2097 packages in 17.793s
remote:
remote: 119 packages are looking for funding
remote: run `npm fund` for details
remote:
remote: found 0 vulnerabilities
remote:
remote: audited 2098 packages in 15.157s
remote:
remote: 119 packages are looking for funding
remote: run `npm fund` for details
remote:
remote: found 0 vulnerabilities
remote:
remote:
remote: > cloth-app@0.1.0 build /tmp/build_5f5304d1/client
remote: > react-scripts build
remote:
remote:
remote:sh: 1: react-scripts: Permission denied
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 126
remote: npm ERR! cloth-app@0.1.0 build: `react-scripts build`
remote: npm ERR! Exit status 126
remote: npm ERR!
remote: npm ERR! Failed at the cloth-app@0.1.0 build script.
remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /tmp/npmcache.Hb9pQ/_logs/2020-11-29T17_00_20_934Z-debug.log
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 126
remote: npm ERR! cloth-app-server@1.0.0 heroku-postbuild: `cd client && npm install && npm
install --only=dev --no-shrinkwrap && npm ru
n build`
remote: npm ERR! Exit status 126
remote: npm ERR!
remote: npm ERR! Failed at the cloth-app-server@1.0.0 heroku-postbuild script.
remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /tmp/npmcache.Hb9pQ/_logs/2020-11-29T17_00_20_948Z-debug.log
remote:
remote: -----> Build failed
remote:
remote: We're sorry this build is failing! You can troubleshoot common issues here:
remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote: If you're stuck, please submit a ticket so we can help:
remote: https://help.heroku.com/
remote:
remote: Love,
remote: Heroku
remote:
remote: ! Push rejected, failed to compile React.js (create-react-app) multi app.
remote:
remote: ! Push failed
警告 - 此代码的相同版本已经构建:
b0343f5ec830fbc6a90f86fcc2690651a771585a
remote: !
remote: ! ## Warning - The same version of this code has already been built:
b0343f5ec830fbc6a90f86fcc2690651a771585a
remote: !
remote: ! We have detected that you have triggered a build from source code with version
b0343f5ec830fbc6a90f86fcc2690651a771585a
remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a
different branch.
remote: !
remote: ! If you are developing on a branch and deploying via git you must run:
remote: !
remote: ! git push heroku <branchname>:main
remote: !
remote: ! This article goes into details on the behavior:
remote: ! https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to aj-clothing.
remote:
To https://git.heroku.com/aj-clothing.git
! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/aj-clothing.git'
解决方案
我只是重新安装节点包。求帮助
推荐阅读
- javascript - 如何使用 Angular 6 ngFor 将子元素显示为父元素
- javascript - 如何在 SVG 上绘制与给定图像数据形状完全相同的折线对象
- c++ - 创建 C++ 链接列表时出现编译错误。架构 x86_64 的未定义符号:
- python - 无法在 Python 3 中的 Selenium 上设置 Luminati 代理
- sql - 从特定组 [符号] 中删除特定行 [时间] 的 SQL 语法
- android - 如何使用 android 处理 ASP.NET post 方法?
- c# - 我可以将 MVC5 项目添加到现有(仍在运行)ASPX 项目中吗
- python - 列表索引超出范围 Openpyxl
- compiler-construction - 编译器和处理器优化如何加速代码执行?
- c# - 是否可以使用通用 smtp 主机从任何类型的电子邮件发送电子邮件?