question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot start nuxt: Cannot find module '#ansi-styles' (Fresh Install - Windows 10)

See original GitHub issue

Environment

  • Operating System: Windows_NT
  • Node Version: v16.13.2
  • Nuxt Version: 3.0.0-27385496.7a1cf62
  • Package Manager: yarn@1.22.17
  • Bundler: Vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

  1. Cloned the starter project npx nuxi init nuxt3-app
  2. yarn install
  3. yarn dev

Describe the bug

I’ve followed the installation steps, and after yarn dev I receive this error: ERROR Cannot start nuxt: Cannot find module '#ansi-styles'

Additional context

No response

Logs

ERROR  Cannot start nuxt:  Cannot find module '#ansi-styles'                                                                                                   

Require stack:
- .../nuxt3-app/node_modules/@nuxt/nitro/node_modules/chalk/source/index.js

  Require stack:
  - .../nuxt3-app/node_modules/@nuxt/nitro/node_modules/chalk/source/index.js
  at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
  at Function.resolve (node:internal/modules/cjs/helpers:108:19)
  at _resolve (node_modules\jiti\dist\jiti.js:1:192527)
  ...

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
ggdiamcommented, Jan 26, 2022

for npm 8.3.2 it’s

"devDependencies": {
  "nuxt3": "latest"
},
"overrides": {
  "chalk": "^4.1.2"
}

make sure using latest npm 8.3.2 (npm install -g npm@latest to update)

2reactions
danielroecommented, Jan 27, 2022

It looks like this may have been fixed. Can you reproduce with a fresh install or (npx nuxi upgrade --force)?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Cannot find module nuxt.js, why my app don't start?
C:\Users\anyel\Documents\src\nuxt\bin\nuxt.js. try path: script: './node_modules/nuxt/bin/nuxt.js', ... Try and install nuxt-start package.
Read more >
Solved: Cannot find module react : npm install - YouTube
start Windows PowerShell and use npm install. ... Your browser can't play this video. ... Solved: Cannot find module react : npm install....
Read more >
Fix Global Installs Not Working | "Cannot find module" error FIX
Getting " Cannot find module " after installing something globally (with -g)? Well, this video shows you how to fix global package/module ...
Read more >
nuxt-push-plugins - npm
Start using nuxt-push-plugins in your project by running `npm i ... addPlugin inside a Nuxt module, Nuxt does in fact not add the...
Read more >
cannot find module '@vue/composition-api' - You.com
Stop the project and # if you use yarn $ yarn add @vue/composition-api # if you use npm $ npm install @vue/composition-api --save....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found