I’m currently facing an issue while trying to deploy my Nuxt 3 app on Cloudflare Pages. The error message I’m encountering states that the ‘nuxt-security’ package is not found. I’ve exhausted all possible solutions and find myself stuck. Right now, my app is live on AWS, but I’m eager to transition it to Cloudflare Pages. If anyone has experience with this and can lend a hand, I would greatly appreciate it!
Can you provide any more details or a minimal way for us to reproduce the error? Do you have the
nuxt-security package in your
package.json? What’s the exact full error that you get in your build log?
To reproduce the error, please follow these steps:
- Install “nuxt-security” in your Nuxt.js application by adding it to your package.json.
- Attempt to deploy your application using Git.
It’s worth noting that my application is functioning perfectly, and it is currently live on AWS. I am using PM2 to manage the application’s runtime.
ERROR I got:
||> nuxt prepare
||[error] Error while requiring module
nuxt-security: Error: Cannot find module ‘/opt/buildhome/repo/nuxt-security’
||[error] Cannot find module ‘/opt/buildhome/repo/nuxt-security’
||at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
||at Function.resolve (node:internal/modules/cjs/helpers:125:19)
||at Function._resolve [as resolve] (node_modules/jiti/dist/jiti.js:1:250334)
I resolved the issue by removing
NODE_ENV=production to my environment variables. When you have
NODE_ENV=production set in your environment variables, it prevents the installation of dev dependencies. Removing it fixed the problem
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.