# NPM 5 NodeJS 9 Build Errors

**URL:** <https://forums.balena.io/t/npm-5-nodejs-9-build-errors/3113>\
**Category:** Product support\
**Tags:** support, raspberrypi3, docker\
**Created:** [May 9, 2018, 9:15pm UTC](https://forums.balena.io/t/npm-5-nodejs-9-build-errors/3113 "2018-05-09T21:15:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pushtheworld](https://avatars.discourse-cdn.com/v4/letter/p/47e85d/32.png) [@pushtheworld](https://forums.balena.io/u/pushtheworld)\
**Post date:** [May 9, 2018, 9:15pm UTC](https://forums.balena.io/t/npm-5-nodejs-9-build-errors/3113/1 "2018-05-09T21:15:07Z")

</div>

Having trouble installing one of the latest nodes (version 9.11.1).

Everything seems to install but then I get a strange error after, check it out:

```auto
[main] npm notice created a lockfile as package-lock.json. You should commit this file.
[main]
[main] npm WARN bos-server@0.0.1 No repository field.
[main]
[main]
[main]
[main] added 556 packages in 27.532s
[main] npm
[main] ERR!
[main] As of npm@5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead.
[main] npm ERR!
[main]
[main] npm
[main]
[main] ERR!
[main] If you're sure you want to delete the entire cache, rerun this command with --force.
[main]
[main]
[main] npm
[main] ERR!
[main] A complete log of this run can be found in:
[main]
[main] npm
[main] ERR!
[main] /root/.npm/_logs/2018-05-09T21_11_47_317Z-debug.log
[main]
[main] Removing intermediate container ffcaf6495ce1
[main] The command '/bin/sh -c JOBS=MAX npm install --production --unsafe-perm && npm cache clean && rm -rf /tmp/*' returned a non-zero code: 1
[Info] Uploading images
[Success] Successfully uploaded images
[Error] Some services failed to build:
[Error] Service: main
[Error] Error: The command '/bin/sh -c JOBS=MAX npm install --production --unsafe-perm && npm cache clean && rm -rf /tmp/*' returned a non-zero code: 1
[Error] Not deploying release.

```

Any ideas?

---

<div class="post-metadata">

**Author:** ![\_Page](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/_page/32/22_2.png) [@\_Page](https://forums.balena.io/u/_Page)\
**Post date:** [May 9, 2018, 9:19pm UTC](https://forums.balena.io/t/npm-5-nodejs-9-build-errors/3113/4 "2018-05-09T21:19:50Z")

</div>

Hey, the problem is that you’ve used `npm cache clean` in order to make your image smaller which is great for npm 4 and below, but generates that error with npm 5 - to get the same effect for npm 5 you have to use `npm cache clean --force`
