I’m unable to make any API using the Strapi api without getting the below error message.
/Users/xxxxxxxxxxxxx/node_modules/snappy/build/Release/binding.node'.
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1144:18)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:101:18)
at bindings (/Users/xxxxxxxxxxxxx/node_modules/bindings/bindings.js:112:48)
at Object.<anonymous> (/Users/xxxxxxxxxxxxx/node_modules/snappy/snappy.js:2:34)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at Object.require (internal/modules/cjs/helpers.js:101:18)
at _optionalRequire (/Users/xxxxxxxxxxxxx/Documents/xxxxxxxxxxx/node_modules/mongodb/node_modules/optional-require/dist/index.js:111:65)
at x (/Users/xxxxxxxxxxxxx/Documents/xxxxxxxxxxx/node_modules/mongodb/node_modules/optional-require/dist/index.js:172:16)
at Object.retrieveSnappy (/Users/xxxxxxxxxxxxx/Documents/xxxxxxxxxxx/node_modules/mongodb/lib/core/connection/utils.js:49:18)
at Object.<anonymous> (/Users/xxxxxxxxxxxxx/Documents/xxxxxxxxxxx/node_modules/mongodb/lib/core/wireprotocol/compression.js:3:47)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
This error shows up even when I simply do the following:
- Run
npx create-strapi-app@latest my-project --quickstart - Make a Postman request to
/api/auth/local/register/
I expect a user to get created and have a token returned. Instead the above error is shown in the console and a 500 internal error is returned in Postman.
I’ve read all the StackOverflow posts regarding this and I’ve deleted and reinstalled the node_modules file numerous times. I’ve created multiple Strapi Projects and the same thing happens on all of them.
The interesting part is that I setup one instance with a Dockerfile and deployed this instance to ElasticBeanstalk with a database connecting to an RDS instance.
FROM strapi/base
WORKDIR /strapi-app
COPY ./package.json ./
COPY ./yarn.lock ./
RUN yarn install
COPY . .
ENV NODE_ENV development
RUN yarn build
EXPOSE 1337
CMD ["yarn", "start"]
When I try to run the API commands on that instance they work without an issue. I’ve exhausted all resources I can think of and I’m still unable to resolve this issue.
System Information
- Node.js version: v14.19
- NPM version:6.14.13
- Strapi version: 4.0.7
- Database: I’ve tried with Postgres and SQLLite
- Operating system: MacOS 11.6