create-nuxt-app
create-nuxt-app copied to clipboard
Error to Start New Projects
Hello Nuxt JS team,
I got a major issue when I started new project
I tried to run
npx create-nuxt-app
It throw me an error
internal/modules/cjs/loader.js:628 throw e; ^ Error: No valid exports main found for '/usr/local/lib/node_modules/create-nuxt-app/node_modules/cac' at resolveExportsTarget (internal/modules/cjs/loader.js:625:9) at applyExports (internal/modules/cjs/loader.js:502:14) at resolveExports (internal/modules/cjs/loader.js:551:12) at Function.Module._findPath (internal/modules/cjs/loader.js:657:22) at Function.Module._resolveFilename (internal/modules/cjs/loader.js:960:27) at Function.Module._load (internal/modules/cjs/loader.js:855:27) at Module.require (internal/modules/cjs/loader.js:1033:19) at require (internal/modules/cjs/helpers.js:72:18) at Object.
(/usr/local/lib/node_modules/create-nuxt-app/lib/cli.js:5:13) at Module._compile (internal/modules/cjs/loader.js:1144:30) { code: 'MODULE_NOT_FOUND' }
How could this happen? How could I solve it?
Thanks in advance
Hi, may I know are you still having this issue? Just to share my personal experience, I actually noticed I faced similar issue if I'm running npx create-nuxt-app <project-name>
while in a poor network connection environment. As we can see in your error, it said was looking into /node_modules/cac
, but there is no such module. The modules that are in a new nuxt project with the same starting name are:
- cacache
- cacheable-lookup
- cacheable-request
- cache-base
- cache-loader
So I have reason to believe the poor network connectivity caused it to stop downloading halfway, thus causing errors with incomplete files.
Would you mind running npm cache clean --force
to remove the faulty create-nuxt-app
downloaded by the npx command and retry again?
Hi, I have same problem
Would you mind running npm cache clean --force to remove the faulty create-nuxt-app downloaded by the npx command and retry again?
@HuseyinKaplay Have you tried the solution above?
@azrikahar Yes but they didn't work. I try reinstall node + npm and problem solved.