Nuxt Fatal Error - subpath './package.json' not define in export

1.3k views Asked by At

nuxt version: 2.14.12

After updating packages through npm update and then using npm run dev, the compiler give the fatal error.

Console output

Starting Laravel development server: http://127.0.0.1:3001
[Wed Dec 16 14:00:42 2020] Failed to listen on 127.0.0.1:3001 (reason: Address already in use)
ℹ Preparing project for development                                                                      14:00:42
ℹ Initial build may take a while                                                                         14:00:42

 FATAL  Package subpath './package.json' is not defined by "exports" in /Users/giorgio/localhost/itherapist/node_modules/@nuxt/ufo/package.json

  at applyExports (internal/modules/cjs/loader.js:498:9)
  at resolveExports (internal/modules/cjs/loader.js:514:23)
  at Function.Module._findPath (internal/modules/cjs/loader.js:642:31)
  at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1017:27)
  at Function.Module._load (internal/modules/cjs/loader.js:899:27)
  at Module.require (internal/modules/cjs/loader.js:1090:19)
  at require (internal/modules/cjs/helpers.js:75:18)
  at Resolver.requireModule (node_modules/@nuxt/core/dist/core.js:618:26)
  at Builder.validateTemplate (node_modules/@nuxt/builder/dist/builder.js:5674:38)
  at Builder.build (node_modules/@nuxt/builder/dist/builder.js:5602:12)
  at async Object._buildDev (node_modules/@nuxt/cli/dist/cli-dev.js:106:5)
  at async Object.startDev (node_modules/@nuxt/cli/dist/cli-dev.js:64:7)
  at async Object.run (node_modules/@nuxt/cli/dist/cli-dev.js:51:5)
  at async NuxtCommand.run (node_modules/@nuxt/cli/dist/cli-index.js:2803:7)


   ╭───────────────────────────────────────────────────────────────────────────────────────────────╮
   │                                                                                               │
   │   ✖ Nuxt Fatal Error                                                                          │
   │                                                                                               │
   │   Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './package.json' is not defined by   │
   │   "exports" in /Users/giorgio/localhost/itherapist/node_modules/@nuxt/ufo/package.json        │
   │                                                                                               │
   ╰───────────────────────────────────────────────────────────────────────────────────────────────╯

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @1.0.0 nuxt:dev: `nuxt`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @1.0.0 nuxt:dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/giorgio/.npm/_logs/2020-12-16T14_00_42_897Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @1.0.0 dev: `npm run mix:dev && npm run nuxt:dev`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I have already tried to reinstall all the packages with the same result.

1

There are 1 answers

1
J03Bukowski On

Easy fix at the end: update node.js