# Taking advantage of npm ci

**URL:** <https://discuss.circleci.com/t/taking-advantage-of-npm-ci/20734>\
**Category:** Build Environment\
**Tags:** npm\
**Created:** [March 15, 2018, 2:12am UTC](https://discuss.circleci.com/t/taking-advantage-of-npm-ci/20734 "2018-03-15T02:12:16Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![heridev](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/heridev/32/18496_2.png) [@heridev](https://discuss.circleci.com/u/heridev)\
**Post date:** [May 31, 2018, 1:01am UTC](https://discuss.circleci.com/t/taking-advantage-of-npm-ci/20734/7 "2018-05-31T01:01:16Z")

</div>

I spent some time figuring the `npm` command not found error and it turns out it was the `sudo` the cause so no need to use sudo:

```auto
command: npmv=$(echo $(npm -v) | head -c 1); if ["$npmv" -lt "6"]; then npm i -g npm; else echo "Node.js Docker Team finally decided to include npm v6+ in latest image; you can remove this script now"; fi

```

---

_[View the full topic](https://discuss.circleci.com/t/taking-advantage-of-npm-ci/20734)._
