tack Error: Cannot find module 'aws-sdk'
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.2k
- Forks
- 271
- Avg merge
- 23h 40m
- Merged PRs (30d)
- 2
Description
I encounter the following issue when following [these instructions](https://www.zigbee2mqtt.io/guide/installation/01_linux.html#installing) to configure zigbee2mqtt in a lxd container.
I did apt update & upgrade, but it does not help. Note that in lxd containers, there is only root.
```
root@OpenHAB:/opt/zigbee2mqtt# node --version
v10.19.0
root@OpenHAB:/opt/zigbee2mqtt# npm --version
6.14.4
```
```
root@OpenHAB:/opt/zigbee2mqtt# node-pre-gyp info ok
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.10.2
node-pre-gyp info using node@10.19.0 | linux | x64
node-pre-gyp ERR! UNCAUGHT EXCEPTION
node-pre-gyp ERR! stack Error: Cannot find module 'aws-sdk'
node-pre-gyp ERR! stack at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
node-pre-gyp ERR! stack at Function.Module._load (internal/modules/cjs/loader.js:562:25)
node-pre-gyp ERR! stack at Module.require (internal/modules/cjs/loader.js:692:17)
node-pre-gyp ERR! stack at require (internal/modules/cjs/helpers.js:25:18)
node-pre-gyp ERR! stack at unpublish (/usr/lib/nodejs/node-pre-gyp/lib/info.js:14:15)
node-pre-gyp ERR! stack at Object.self.commands.(anonymous function) [as info] (/usr/lib/nodejs/node-pre-gyp/lib/node-pre-gyp.js:52:37)
node-pre-gyp ERR! stack at run (/usr/lib/nodejs/node-pre-gyp/bin/node-pre-gyp:82:30)
node-pre-gyp ERR! stack at Object. (/usr/lib/nodejs/node-pre-gyp/bin/node-pre-gyp:134:1)
node-pre-gyp ERR! stack at Module._compile (internal/modules/cjs/loader.js:778:30)
node-pre-gyp ERR! stack at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
node-pre-gyp ERR! System Linux 5.8.0-53-generic
node-pre-gyp ERR! command "/usr/bin/node" "/usr/bin/node-pre-gyp" "info" "ok"
node-pre-gyp ERR! cwd /opt/zigbee2mqtt
node-pre-gyp ERR! node -v v10.19.0
node-pre-gyp ERR! node-pre-gyp -v v0.10.2
node-pre-gyp ERR! This is a bug in `node-pre-gyp`.
node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not help:
node-pre-gyp ERR!
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the installation steps from the linked guide in an LXD container, then start at /usr/lib/nodejs/node-pre-gyp/lib/info.js:14, where the stack trace reports the missing aws-sdk module. Trace how the node-pre-gyp dependency is installed and determine what change makes `node-pre-gyp info ok` complete successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100