# External Npm modules cannot be referenced v1.0(Bug)

**URL:** <https://forum.serverless.com/t/external-npm-modules-cannot-be-referenced-v1-0-bug/264>\
**Category:** Serverless Framework\
**Tags:** aws\
**Created:** [September 9, 2016, 7:49am UTC](https://forum.serverless.com/t/external-npm-modules-cannot-be-referenced-v1-0-bug/264 "2016-09-09T07:49:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lakshman-LD](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@Lakshman-LD](https://forum.serverless.com/u/Lakshman-LD)\
**Post date:** [September 9, 2016, 7:49am UTC](https://forum.serverless.com/t/external-npm-modules-cannot-be-referenced-v1-0-bug/264/1 "2016-09-09T07:49:42Z")

</div>

- I am trying to use moment.js inside the handler, but I get an error **moment is not defined**. Moreover, I followed the documentation provided [here](https://github.com/serverless/serverless/tree/master/docs/02-providers/aws/examples/using-external-libraries/node).

- Further, on discussing in gitter, it works for some when they take the npm modules out of node\_modules and put it in the same hierarchy as handler.js. In spite of doing the above change, I still get **not referenced error**.

## Additional Data

- **_Serverless Framework Version you’re using_** : 1.0.0-rc.1
- **_Operating System_** : ubuntu 14.04 trusty
- **_Stack Trace_** : referenceError: moment is not defined.
- **_Provider Error messages_** : Runtime error

---

<div class="post-metadata">

**Author:** ![chamathsilva](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@chamathsilva](https://forum.serverless.com/u/chamathsilva)\
**Post date:** [September 9, 2016, 7:56am UTC](https://forum.serverless.com/t/external-npm-modules-cannot-be-referenced-v1-0-bug/264/2 "2016-09-09T07:56:07Z")

</div>

I got the same error

**Serverless Framework Version you’re using** : 1.0.0-beta.2  
**Operating System** : Windows 10 enterprise

---

<div class="post-metadata">

**Author:** ![flomotlik](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/flomotlik/32/3_2.png) [@flomotlik](https://forum.serverless.com/u/flomotlik)\
**Post date:** [September 17, 2016, 1:52pm UTC](https://forum.serverless.com/t/external-npm-modules-cannot-be-referenced-v1-0-bug/264/3 "2016-09-17T13:52:31Z")

</div>

Can you run `serverless deploy --noDeploy` and inspect the created artifacts if they contain all dependencies and the handler file correctly requires the right path?

---

<div class="post-metadata">

**Author:** ![Lakshman-LD](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@Lakshman-LD](https://forum.serverless.com/u/Lakshman-LD)\
**Post date:** [September 28, 2016, 6:19am UTC](https://forum.serverless.com/t/external-npm-modules-cannot-be-referenced-v1-0-bug/264/4 "2016-09-28T06:19:40Z")

</div>

It was my mistake. I was not properly referencing the modules. It works properly.
