首页 > 解决方案 > 构建失败为什么?

问题描述

构建一直失败帮助!,如果我的 package.json 的详细信息可以发送,与该项目关联的 repo 是私有的。

   -----> Node.js app detected

-----> Creating runtime environment

       NPM_CONFIG_LOGLEVEL=error
       NODE_ENV=production
       NODE_MODULES_CACHE=true
       NODE_VERBOSE=false

-----> Installing binaries
       engines.node (package.json):  unspecified
       engines.npm (package.json):   unspecified (use default)
       engines.yarn (package.json):  unspecified (use default)

       Resolving node version 10.x...
       Downloading and installing node 10.15.1...
       Using default npm version: 6.4.1
       Resolving yarn version 1.x...
       Downloading and installing yarn (1.14.0)...
       Installed yarn 1.14.0

-----> Building dependencies
       Installing node modules (yarn.lock)
       yarn install v1.14.0
       error An unexpected error occurred: "/tmp/build_92785ec867666d739a3a4a010d233406/package.json: Unexpected token { in JSON at position 2383".
       info If you think this is a bug, please open a bug report with the information provided in "/tmp/build_92785ec867666d739a3a4a010d233406/yarn-error.log".
       info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
-----> Build failed

       We're sorry this build is failing! You can troubleshoot common issues here:
       https://devcenter.heroku.com/articles/troubleshooting-node-deploys

       Some possible problems:

       - Node version not specified in package.json
         https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version

       Love,
       Heroku

 !     Push rejected, failed to compile Node.js app.
 !     Push failed

构建一直失败帮助!,如果我的 package.json 的详细信息可以发送,与该项目关联的 repo 是私有的。

标签: reactjsherokucommand-line-interfacegatsby

解决方案


问题已修复,我的posts数组未定义。我检查了他们是否真的回来了,如果没有,他们为什么不回来并看到了posts was not defined


推荐阅读