# Npm run build fails only on netlify with the error: The "from" argument must be of type string. Received undefined

**URL:** <https://answers.netlify.com/t/npm-run-build-fails-only-on-netlify-with-the-error-the-from-argument-must-be-of-type-string-received-undefined/68436>\
**Category:** Support\
**Tags:** building\
**Created:** [June 18, 2022, 11:13am UTC](https://answers.netlify.com/t/npm-run-build-fails-only-on-netlify-with-the-error-the-from-argument-must-be-of-type-string-received-undefined/68436 "2022-06-18T11:13:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![smaikap](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/smaikap/32/38345_2.png) [@smaikap](https://answers.netlify.com/u/smaikap)\
**Post date:** [June 18, 2022, 11:13am UTC](https://answers.netlify.com/t/npm-run-build-fails-only-on-netlify-with-the-error-the-from-argument-must-be-of-type-string-received-undefined/68436/1 "2022-06-18T11:13:46Z")

</div>

The issue: I have a gatsby blog on netlify [happy-ardinghelli-804962.netlify.app → [sukantamaikap.com](http://sukantamaikap.com)]. I’m facing the below build failure only during build on netlify (on local [mac with exact same node version], it passes like a breeze)

```auto
9:12:12 PM: npm ERR! code ERR_INVALID_ARG_TYPE
9:12:12 PM: npm ERR! The "from" argument must be of type string. Received undefined
9:12:12 PM: npm ERR! A complete log of this run can be found in:
9:12:12 PM: npm ERR! /opt/buildhome/.npm/_logs/2022-06-18T11_11_13_975Z-debug-0.log
9:12:12 PM: Error during NPM install
9:12:12 PM: Build was terminated: Build script returned non-zero exit code: 1

```

I tried the usual fix from StackOverflow without any help.

Here is my `netlify.toml`:

```plaintext
[build]
  publish = "public"
  command = "gatsby build"
[build.environment]
  NODE_VERSION = "16.15.1"

```

Build Log: [Netlify App](https://app.netlify.com/sites/happy-ardinghelli-804962/deploys/62adb2a1474f2a00087740bd)

---

<div class="post-metadata">

**Author:** ![coelmay](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/coelmay/32/24427_2.png) [@coelmay](https://answers.netlify.com/u/coelmay)\
**Post date:** [June 18, 2022, 12:00pm UTC](https://answers.netlify.com/t/npm-run-build-fails-only-on-netlify-with-the-error-the-from-argument-must-be-of-type-string-received-undefined/68436/2 "2022-06-18T12:00:24Z")

</div>

Hey @smaikap

This issue is possibly due to node `v16.15.1` as outlined in the [Node v16.15.1 (npm v8.11.0) breaks some builds](https://answers.netlify.com/t/node-v16-15-1-npm-v8-11-0-breaks-some-builds/64367). Possibly changing this to `v16.15.0` may prove successful.

---

<div class="post-metadata">

**Author:** ![smaikap](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/smaikap/32/38345_2.png) [@smaikap](https://answers.netlify.com/u/smaikap)\
**Post date:** [June 19, 2022, 11:36am UTC](https://answers.netlify.com/t/npm-run-build-fails-only-on-netlify-with-the-error-the-from-argument-must-be-of-type-string-received-undefined/68436/3 "2022-06-19T11:36:56Z")

</div>

Negative, moving to 16.15.0 does not help

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [June 19, 2022, 1:33pm UTC](https://answers.netlify.com/t/npm-run-build-fails-only-on-netlify-with-the-error-the-from-argument-must-be-of-type-string-received-undefined/68436/4 "2022-06-19T13:33:38Z")

</div>

Unfortunately, the error is with one of your dependencies than Netlify. You need to find which one. With a non-public repo, we cannot comment on that.

---

<div class="post-metadata">

**Author:** ![smaikap](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/smaikap/32/38345_2.png) [@smaikap](https://answers.netlify.com/u/smaikap)\
**Post date:** [June 20, 2022, 6:53am UTC](https://answers.netlify.com/t/npm-run-build-fails-only-on-netlify-with-the-error-the-from-argument-must-be-of-type-string-received-undefined/68436/5 "2022-06-20T06:53:47Z")

</div>

It started working once I moved the base image to `Ubuntu Focal 20.04` from `Ubuntu Xenial 16.04`
