Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read properties of undefined (reading 'rootDir') #202

Open
halilyuce opened this issue May 13, 2024 · 1 comment
Open

Cannot read properties of undefined (reading 'rootDir') #202

halilyuce opened this issue May 13, 2024 · 1 comment

Comments

@halilyuce
Copy link

Describe the bug
After doing the npm audit fix, my nuxt-windicss package was updated to "nuxt-windicss": "^2.0.15", and after that, when I added "nuxt-windicss" under modules in the nuxt.config.ts file, when I ran the npm commands (npm install etc) I get this error:

command failed
npm ERR! command sh -c nuxt prepare
npm ERR! I get the error ERROR Cannot read properties of undefined (reading 'rootDir')
at node_modules/nuxt-windicss/dist/module.mjs:74:24
npm ERR!   at normalizedModule (/Users/yuce/Documents/GitHub/portal/node_modules/@nuxt/kit/dist/index.mjs:2112:38)
npm ERR!   at async installModule (/Users/yuce/Documents/GitHub/portal/node_modules/@nuxt/kit/dist/index.mjs:2415:95)
npm ERR!   at async initNuxt (/Users/yuce/Documents/GitHub/portal/node_modules/nuxt/dist/index.mjs:4233:7)
npm ERR!   at async loadNuxt (/Users/yuce/Documents/GitHub/portal/node_modules/nuxt/dist/index.mjs:4331:5)
npm ERR!   at async loadNuxt (/Users/yuce/Documents/GitHub/portal/node_modules/@nuxt/kit/dist/index.mjs:2570:19)
npm ERR!   at async Object.run (/Users/yuce/Documents/GitHub/portal/node_modules/nuxi/dist/chunks/prepare.mjs:53:18)
npm ERR!   at async runCommand$1 (/Users/yuce/Documents/GitHub/portal/node_modules/nuxi/dist/shared/nuxi.9edf0930.mjs:1648:16)
npm ERR!   at async runCommand$1 (/Users/yuce/Documents/GitHub/portal/node_modules/nuxi/dist/shared/nuxi.9edf0930.mjs:1639:11)
npm ERR!   at async runMain$1 (/Users/yuce/Documents/GitHub/portal/node_modules/nuxi/dist/shared/nuxi.9edf0930.mjs:1777:7) 

my nuxt and vue versions:

"nuxt": "^3.11.2",
"vue": "3.4.21",

To Reproduce
Steps to reproduce the behavior:

  1. Upgrade the nuxt-windicss package to the latest version
  2. Run npm install command
  3. See error

Expected behavior
Commands run smoothly

Additional context
The problem goes away when I remove the "nuxt-windicss" line from modules in nuxt.config.ts file but I need it.

@halilyuce
Copy link
Author

@harlan-zw

npm finds audit problems in version 2.6.1 and as you see, when I run the "npm audit fix --force", it updates it to version 2.0.15 and in this version it causes the error

Cannot start nuxt: Cannot read properties of undefined (reading 'rootDir')

I hit a dead end.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant