Error cannot find module - new nuxt3 app
Hi!
I've updated my node version, from the 18.14.0 to the 18.17.0 and all my nuxt apps stops responding. Afer i tried to install a new fresh nuxt3 app, and identical error.
The errors are like:
ERROR Error while requiring module C:/Program Files/nodejs/node_modules/@nuxt/devtools/module.cjs: Error: Cannot find module 'C:/Program Files/nodejs/node_modules/@nuxt/devtools/module.cjs' 19:55:42
Require stack: - C:\Users\jpedr\nuxt3C\index.js Some case are the devtools other are other modules, but what is strange, is the path...all cases are looking in the folder where nodejs is installed...the "Program Files" folder instead of the folder of the app, inside the node_modules, right? I've unnistalled nvm, yarn, pnpm and nodeJS and installed just one of them, but always the same kind of error, please someone help me. Note; If i'm using node 18.14.0, some nuxt3 app work fine, but whatever the version of nodejs I can't install a new nuxt3 app.
Require stack: - C:\Users\jpedr\nuxt3C\index.js Some case are the devtools other are other modules, but what is strange, is the path...all cases are looking in the folder where nodejs is installed...the "Program Files" folder instead of the folder of the app, inside the node_modules, right? I've unnistalled nvm, yarn, pnpm and nodeJS and installed just one of them, but always the same kind of error, please someone help me. Note; If i'm using node 18.14.0, some nuxt3 app work fine, but whatever the version of nodejs I can't install a new nuxt3 app.
1 Reply
Hi!
After a terrible night, the issue was with yarn 2, that enables the corepack of the nodeJs.
Solution:
corepack disable