heroku - Heroku 无法构建 -Node
问题描述
我正在尝试通过heroku托管我的网站,但是无论我做什么,构建都会不断失败。构建在本地工作,但是当我尝试推送到heroku时,我不断得到这个
Counting objects: 1324, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (609/609), done.
Writing objects: 100% (1324/1324), 28.24 MiB | 0 bytes/s, done.
Total 1324 (delta 681), reused 1324 (delta 681)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NODE_VERBOSE=false
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): ^10.7
remote: engines.npm (package.json): unspecified (use default)
remote: engines.yarn (package.json): ^1.5
remote:
remote: Resolving node version ^10.7...
remote: Downloading and installing node 10.9.0...
remote: Using default npm version: 6.2.0
remote: Resolving yarn version ^1.5...
remote: Downloading and installing yarn (1.9.4)...
remote: Installed yarn 1.9.4
remote:
remote: -----> Restoring cache
remote: Skipping cache restore (not-found)
remote:
remote: -----> Building dependencies
remote: Installing node modules (yarn.lock)
remote: yarn install v1.9.4
remote: [1/4] Resolving packages...
remote: [2/4] Fetching packages...
remote: warning Pattern ["@types/koa@latest"] is trying to unpack in the same destination "/tmp/yarncache.80EhH/v2/npm-@types/koa-2.0.46-24bc3cd405d10fcde81f876cd8285
b44d4ddc3e9" as pattern ["@types/koa@*","@types/koa@*","@types/koa@*","@types/koa@*","@types/koa@*","@types/koa@*","@types/koa@*","@types/koa@*","@types/koa@*"]. This could
result in non-deterministic behavior, skipping.
remote: warning Pattern ["@types/node@latest"] is trying to unpack in the same destination "/tmp/yarncache.80EhH/v2/npm-@types/node-10.9.2-f0ab8dced5cd6c56b26765e1c0d
9e4fdcc9f2a00" as pattern ["@types/node@*","@types/node@*","@types/node@*","@types/node@*","@types/node@*","@types/node@*","@types/node@*","@types/node@*","@types/node@*","@
types/node@*","@types/node@*","@types/node@*","@types/node@*","@types/node@*","@types/node@*"]. This could result in non-deterministic behavior, skipping.
remote: warning Pattern ["koa-convert@latest"] is trying to unpack in the same destination "/tmp/yarncache.80EhH/v2/npm-koa-convert-1.2.0-da40875df49de0539098d1700b50
820cebcd21d0" as pattern ["koa-convert@^1.2.0"]. This could result in non-deterministic behavior, skipping.
remote: warning Pattern ["qs@latest"] is trying to unpack in the same destination "/tmp/yarncache.80EhH/v2/npm-qs-6.5.2-cb3ae806e8740444584ef154ce8ee98d403f3e36" as p
attern ["qs@^6.4.0"]. This could result in non-deterministic behavior, skipping.
remote: (node:257) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or
Buffer.from() methods instead.
remote: [1/4] Resolving packages...
remote: [2/4] Fetching packages...
remote: error An unexpected error occurred: "ENOENT: no such file or directory, scandir '/tmp/yarncache.80EhH/v2/npm-path-key-2.0.1-411cadb574c5a140d3a4b1910d40d80cc9
f40b40'".
remote: info If you think this is a bug, please open a bug report with the information provided in "/tmp/build_11ee5794ef73ae92c415ea71c412314f/yarn-error.log".
remote: info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
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 Node.js app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to sun-it-solution.
remote:
To https://git.heroku.com/sun-it-solution.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/sun-it-solution.git'
我也尝试运行yarn cache clean
,删除所有node_modules并运行yarn install
,但构建仍然失败
我被困在这里:(我也搜索了一些其他的东西,但我无法解决问题请帮忙
解决方案
推荐阅读
- javascript - @fortawesome/react-fontawesome 图标未调整大小
- javascript - 如何创建 JWT?
- python - add_format 与 xlsxwriter 无法按预期工作
- java - Java 如果我有一个 javax.servlet.http.Part 数组,那么一个部分是否总是代表一个文件
- 3d - 如何修复 3D 平台游戏的跳转代码?
- reporting-services - 在 SSRS 文本段落中添加超链接
- powershell - 获取无法将“System.Object []”转换为 Add-PowerBIRow 的参数“DatasetId”所需的类型“System.Guid”
- winapi - postmessage return 传递给系统调用的数据区域太小
- excel - excel - 如果公式条件
- regex - 删除文件中两个字符串匹配项之间的所有内容