添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Hi my build is failing with a Gyp error which is rather interesting as I had the issue locally and I fixed it here is my build output

12:52:35 AM: Build ready to start
12:52:39 AM: build-image version: fa439ad1ab9393b2c0d449d8d7c033927683f4b0
12:52:39 AM: build-image tag: v4.3.0
12:52:39 AM: buildbot version: ddbb47739f5b85c954aad9dc3823ab0676432957
12:52:39 AM: Fetching cached dependencies
12:52:39 AM: Failed to fetch cache, continuing with build
12:52:39 AM: Starting to prepare the repo for build
12:52:39 AM: No cached dependencies found. Cloning fresh repo
12:52:39 AM: git clone https://github.com/yepstein1/user_preferences
12:52:41 AM: Preparing Git Reference refs/heads/master
12:52:41 AM: Parsing package.json dependencies
12:52:42 AM: Starting build script
12:52:42 AM: Installing dependencies
12:52:42 AM: Python version set to 2.7
12:52:42 AM: Downloading and installing node v16.9.1...
12:52:43 AM: Downloading https://nodejs.org/dist/v16.9.1/node-v16.9.1-linux-x64.tar.xz...
12:52:43 AM: Computing checksum with sha256sum
12:52:43 AM: Checksums matched!
12:52:46 AM: Now using node v16.9.1 (npm v7.21.1)
12:52:46 AM: Started restoring cached build plugins
12:52:46 AM: Finished restoring cached build plugins
12:52:46 AM: Attempting ruby version 2.7.2, read from environment
12:52:48 AM: Using ruby version 2.7.2
12:52:48 AM: Using PHP version 8.0
12:52:48 AM: Started restoring cached node modules
12:52:48 AM: Finished restoring cached node modules
12:52:48 AM: Installing NPM modules using NPM version 7.21.1
12:53:38 AM: npm WARN deprecated [email protected]: flatten is deprecated in favor of utility frameworks such as lodash.
12:53:38 AM: npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
12:53:39 AM: npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
12:53:39 AM: npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
12:53:39 AM: npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
12:53:40 AM: npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
12:53:40 AM: npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
12:53:40 AM: npm WARN deprecated @hapi/[email protected]: Moved to 'npm install @sideway/address'
12:53:41 AM: npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
12:53:42 AM: npm WARN deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-babel.
12:53:45 AM: npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
12:53:46 AM: npm WARN deprecated [email protected]: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
12:53:46 AM: npm WARN deprecated @hapi/[email protected]: Switch to 'npm install joi'
12:53:50 AM: npm WARN deprecated [email protected]: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
12:53:53 AM: npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
12:53:54 AM: npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
12:53:54 AM: npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
12:53:57 AM: npm WARN deprecated [email protected]: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
12:54:00 AM: npm WARN deprecated [email protected]: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
12:54:09 AM: npm ERR! code 1
12:54:09 AM: npm ERR! path /opt/build/repo/node_modules/libpq
12:54:09 AM: npm ERR! command failed
12:54:09 AM: npm ERR! command sh -c node-gyp rebuild
12:54:09 AM: npm ERR! gyp info it worked if it ends with ok
12:54:09 AM: npm ERR! gyp info using [email protected]
12:54:09 AM: npm ERR! gyp info using [email protected] | linux | x64
12:54:09 AM: npm ERR! gyp info find Python using Python version 3.8.10 found at "/usr/bin/python3"
12:54:09 AM: npm ERR! gyp http GET https://nodejs.org/download/release/v16.9.1/node-v16.9.1-headers.tar.gz
12:54:09 AM: npm ERR! gyp http 200 https://nodejs.org/download/release/v16.9.1/node-v16.9.1-headers.tar.gz
12:54:09 AM: npm ERR! gyp http GET https://nodejs.org/download/release/v16.9.1/SHASUMS256.txt
12:54:09 AM: npm ERR! gyp http 200 https://nodejs.org/download/release/v16.9.1/SHASUMS256.txt
12:54:09 AM: npm ERR! (node:1333) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
12:54:09 AM: npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)
12:54:09 AM: npm ERR! gyp info spawn /usr/bin/python3
12:54:09 AM: npm ERR! gyp info spawn args [
12:54:09 AM: npm ERR! gyp info spawn args   '/opt/buildhome/.nvm/versions/node/v16.9.1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
12:54:09 AM: npm ERR! gyp info spawn args   'binding.gyp',
12:54:09 AM: npm ERR! gyp info spawn args   '-f',
12:54:09 AM: npm ERR! gyp info spawn args   'make',
12:54:09 AM: npm ERR! gyp info spawn args   '-I',
12:54:09 AM: npm ERR! gyp info spawn args   '/opt/build/repo/node_modules/libpq/build/config.gypi',
12:54:09 AM: npm ERR! gyp info spawn args   '-I',
12:54:09 AM: npm ERR! gyp info spawn args   '/opt/buildhome/.nvm/versions/node/v16.9.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
12:54:09 AM: npm ERR! gyp info spawn args   '-I',
12:54:09 AM: npm ERR! gyp info spawn args   '/opt/buildhome/.cache/node-gyp/16.9.1/include/node/common.gypi',
12:54:09 AM: npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
12:54:09 AM: npm ERR! gyp info spawn args   '-Dvisibility=default',
12:54:09 AM: npm ERR! gyp info spawn args   '-Dnode_root_dir=/opt/buildhome/.cache/node-gyp/16.9.1',
12:54:09 AM: npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/opt/buildhome/.nvm/versions/node/v16.9.1/lib/node_modules/npm/node_modules/node-gyp',
12:54:09 AM: npm ERR! gyp info spawn args   '-Dnode_lib_file=/opt/buildhome/.cache/node-gyp/16.9.1/<(target_arch)/node.lib',
12:54:09 AM: npm ERR! gyp info spawn args   '-Dmodule_root_dir=/opt/build/repo/node_modules/libpq',
12:54:09 AM: npm ERR! gyp info spawn args   '-Dnode_engine=v8',
12:54:09 AM: npm ERR! gyp info spawn args   '--depth=.',
12:54:09 AM: npm ERR! gyp info spawn args   '--no-parallel',
12:54:09 AM: npm ERR! gyp info spawn args   '--generator-output',
12:54:09 AM: npm ERR! gyp info spawn args   'build',
12:54:09 AM: npm ERR! gyp info spawn args   '-Goutput_dir=.'
12:54:09 AM: npm ERR! gyp info spawn args ]
12:54:09 AM: npm ERR! find: ‘/usr/pg*’: No such file or directory
12:54:09 AM: npm ERR! gyp: Call to 'which pg_config || find /usr/bin /usr/local/bin /usr/pg* /opt -executable -name pg_config -print -quit' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
12:54:09 AM: npm ERR! gyp ERR! configure error
12:54:09 AM: npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
12:54:09 AM: npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (/opt/buildhome/.nvm/versions/node/v16.9.1/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
12:54:09 AM: Creating deploy upload records
12:54:09 AM: npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:394:28)
12:54:09 AM: npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
12:54:09 AM: npm ERR! gyp ERR! System Linux 4.19.167+
12:54:09 AM: npm ERR! gyp ERR! command "/opt/buildhome/.nvm/versions/node/v16.9.1/bin/node" "/opt/buildhome/.nvm/versions/node/v16.9.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
12:54:09 AM: npm ERR! gyp ERR! cwd /opt/build/repo/node_modules/libpq
12:54:09 AM: npm ERR! gyp ERR! node -v v16.9.1
12:54:09 AM: npm ERR! gyp ERR! node-gyp -v v7.1.2
12:54:09 AM: npm ERR! gyp ERR! not ok
12:54:09 AM: npm ERR! A complete log of this run can be found in:
12:54:09 AM: npm ERR!     /opt/buildhome/.npm/_logs/2021-09-15T04_54_09_062Z-debug.log
12:54:09 AM: Error during NPM install
12:54:09 AM: Failed during stage 'building site': Build script returned non-zero exit code: 1
12:54:09 AM: Build was terminated: Build script returned non-zero exit code: 1
12:54:09 AM: Failing build: Failed to build site
12:54:09 AM: Finished processing build request in 1m29.976539779s

my site name is sad-ride-ceece0
I would really appreciate any help, thanks!

[Support Guide] Can I run a web server, HTTP listener, and/or database at Netlify? Support Guides Last reviewed by Netlify Support on December 2022 How do I run a server/database at Netlify? We often get questions about how to run a specific backend server or database at Netlify. Examples of these types of questions include: How to I get my node HTTP listener to respond to requests? How do I start Mongo/MySQL/<insert-some-database-here> running on the server? How can I SSH into my website? We are here today to answer these questions - and the answer is: you can’t! hushed What do you m… Node.js v12 and Express.js serverless-http I am trying to use MongoDB Driver and I have created a DatabaseService singleton class. But I have noticed that the database connection is not being re-used. Do Netlify Functions allow Singleton classes? How can I reuse the MongoDB Client connection in a separate module? Any help would be greatly appreciated!

at either rate, it doesn’t really explain why you can’t at least install the package, but, if what you are hoping to do isn’t feasible anyway, we might not have to fix the first problem :slight_smile:

Lots of reasons:

  • Netlify is running a Docker container and not an actual computer with access to all system-level tools.
  • You get root or sudo permissions on your system, not on Netlify.
  • Libraries might be incompatible with the versions of tools in our build image.
  • Bug(s) in one (or many) of the tools that are present in the build image or in the library being used.
  • There might be more, but you get the point.

    About the problem at hand, I found this:

    Thanks for reporting this. This appears to be
    a bug in libpq. A workaround for this issue seems to be to install postgresql-dev. The full log of the build (which was truncated due to a separate issue with logging) is: gyp info it worked if it ends with ok gyp info using [email protected] gyp info using [email protected] | linux | x64 gyp info find Python using Python version 2.7.12 found at "/opt/buildhome/python2.7/bin/python" gyp http GET https://nodejs.org/download/release/v…

    Following the links and going to another links from those, helped me land on various other threads, but none of them seem to have a definite solution. I tried installing libpq using Brew on Netlify, but that didn’t help too.

    On a related note, I also found this: Timescale Documentation | About psql which talks about various ways of installing some tools on the systems. Maybe something from that helps?

    With that being said, if you do find a solution, it would be great if you could let us know.