# Failing to install aws-sdk for using in function node

**URL:** <https://discourse.nodered.org/t/failing-to-install-aws-sdk-for-using-in-function-node/60901>\
**Category:** General\
**Tags:** function-node\
**Created:** [6 April 2022 21:49 UTC](https://discourse.nodered.org/t/failing-to-install-aws-sdk-for-using-in-function-node/60901 "2022-04-06T21:49:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Barbudor](https://avatars.discourse-cdn.com/v4/letter/b/4af34b/32.png) [@Barbudor](https://discourse.nodered.org/u/Barbudor)\
**Post date:** [6 April 2022 21:49 UTC](https://discourse.nodered.org/t/failing-to-install-aws-sdk-for-using-in-function-node/60901/1 "2022-04-06T21:49:42Z")

</div>

Hi

I would like to write some function node using aws-sdk in my Node-RED running as a docker container (official image nodered/node-red:2.2.2-14).

I tried both

- `npm install aws-sdk` from the command line (from directory `/data` as user node-red) or
- adding module `aws-sdk` import as `AWS` in the setup block of my function node

In both case I end-up with the following error log:

```auto
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated uuid@3.3.2: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path /data/node_modules/aws-sdk
npm ERR! dest /data/node_modules/.aws-sdk.DELETE
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, rename '/data/node_modules/aws-sdk' -> '/data/node_modules/.aws-sdk.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR! /data/.npm/_logs/2022-04-06T21_42_30_350Z-debug.log

```

File : [2022-04-06T21\_42\_30\_350Z-debug.log](https://gist.github.com/barbudor/bee02b77034642b6559c6912b3a6d0f5)

What am I doing wrong ?

Thanks

Barbudor

---

<div class="post-metadata">

**Author:** ![Barbudor](https://avatars.discourse-cdn.com/v4/letter/b/4af34b/32.png) [@Barbudor](https://discourse.nodered.org/u/Barbudor)\
**Post date:** [13 April 2022 16:24 UTC](https://discourse.nodered.org/t/failing-to-install-aws-sdk-for-using-in-function-node/60901/2 "2022-04-13T16:24:33Z")

</div>

Doesn't looks like my issue raise a lot of ideas...

One new things is that this only occurs while I'm running the docker inside an Ubuntu 20.04 in WSL2/Windows 10.

```auto
bash-5.0$ uname -a
Linux 7f9050690eae 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 Linux

```

I don't have the problem with the same docker image running on a true Ubuntu 20.04 machine.

```auto
bash-5.0$ uname -a
Linux 92a04dcc682a 5.13.0-39-generic #44~20.04.1-Ubuntu SMP Thu Mar 24 16:43:35 UTC 2022 x86_64 Linux

```

Does this rings any bell to someone ?  
Any hints if this could be solvable ?

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [12 June 2022 16:25 UTC](https://discourse.nodered.org/t/failing-to-install-aws-sdk-for-using-in-function-node/60901/3 "2022-06-12T16:25:29Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
