Home
Support Forums

Sometimes the deployment fails when installing node_modules

Hi, when I deploy my site, sometimes I catch a deploy failure with the following error log.
I didn’t find a similar problem on this forum.

Site name: something-poincare-cbd22f.netlify.app

Deploy log

11:00:13 AM: Build ready to start
11:00:15 AM: build-image version: c6001ed68662a13e5deb24abec2b46058c58248a
11:00:15 AM: build-image tag: v3.9.0
11:00:15 AM: buildbot version: bfa1ece451875e5fe124c5b0a59bb85e0abb8d50
11:00:15 AM: Building without cache
11:00:15 AM: Starting to prepare the repo for build
11:00:16 AM: No cached dependencies found. Cloning fresh repo
11:00:16 AM: git clone
11:00:17 AM: Preparing Git Reference refs/heads/main
11:00:18 AM: Parsing package.json dependencies
11:00:18 AM: Different build dir detected, going to use the one specified in the Netlify configuration file: ‘’ versus ‘.’ in the Netlify UI
11:00:18 AM: Starting build script
11:00:18 AM: Installing dependencies
11:00:18 AM: Python version set to 2.7
11:00:20 AM: v12.18.0 is already installed.
11:00:20 AM: Now using node v12.18.0 (npm v6.14.4)
11:00:20 AM: Started restoring cached build plugins
11:00:20 AM: Finished restoring cached build plugins
11:00:21 AM: Attempting ruby version 2.7.2, read from environment
11:00:22 AM: Using ruby version 2.7.2
11:00:22 AM: Using PHP version 5.6
11:00:22 AM: Started restoring cached node modules
11:00:22 AM: Finished restoring cached node modules
11:00:23 AM: Installing NPM modules using NPM version 6.14.4
11:00:26 AM: npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See There’s Math.random(), and then there’s Math.random() · V8 for details.
11:00:31 AM: npm WARN deprecated @hapi/joi@15.1.1: Switch to ‘npm install joi’
11:00:31 AM: npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
11:00:35 AM: npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
11:00:36 AM: npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
11:00:36 AM: npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
11:00:36 AM: npm WARN deprecated @hapi/address@2.1.4: Moved to ‘npm install @sideway/address’
11:00:36 AM: npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
11:00:40 AM: npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
11:00:40 AM: npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
11:00:45 AM: npm WARN deprecated core-js@2.6.12: 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.
11:00:47 AM: npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
11:00:47 AM: npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
11:00:52 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules/chokidar/node_modules/fsevents):
11:00:52 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
11:00:52 AM: npm ERR! Unexpected end of JSON input while parsing near ‘…34.0",“babel-eslint”’
11:00:52 AM: npm ERR! A complete log of this run can be found in:
11:00:52 AM: npm ERR! /opt/buildhome/.npm/_logs/2021-09-13T08_00_52_400Z-debug.log
11:00:52 AM: Error during NPM install
11:00:52 AM: Build was terminated: Build script returned non-zero exit code: 1
11:00:52 AM: Creating deploy upload records
11:00:52 AM: Failing build: Failed to build site
11:00:52 AM: Failed during stage ‘building site’: Build script returned non-zero exit code: 1
11:00:52 AM: Finished processing build request in 37.104845016s

Hi @Mobydack,

I was going through your deploys logs and well, the latest one seems a successful one. Are you still seeing this issue?

You already said that it’s sometimes, but wanted to confirm if it’s still happening or has it stopped?

I can’t see this error now, but it started last month and has been repeated about 10 times so far

I personally have seen such an error when I was trying to install a package that was deleted from npm. While that’s probably not the case in your situation, maybe npm is sometimes having troubles resolving the package? There’s no definitive answer.