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 find package '@nuxt/ui-templates'

See original GitHub issue

Environment


  • Operating System: Windows_NT
  • Node Version: v14.18.1
  • Nuxt Version: 2.16.0-27358576.777a4b7f
  • Package Manager: npm@6.14.15
  • Bundler: Webpack
  • User Config: server, head, css, plugins, serverMiddleware, components, buildModules, axios, modules, bootstrapVue, build, auth, router, bridge
  • Runtime Modules: @nuxtjs/axios@5.13.6, @nuxtjs/auth-next@5.0.0-1641544397.1af946a, bootstrap-vue/nuxt, cookie-universal-nuxt@2.1.5, @nuxtjs/moment@1.6.1
  • Build Modules: @nuxtjs/eslint-module@2.0.0, @nuxt/bridge@3.0.0-27449998.32cf973

Reproduction

  1. Upgraded to the latest version of nuxt-edge and nuxt-bridge
  2. npm install
  3. Ran nuxi dev
  4. Error is thrown

Describe the bug

Issue occurs when attempting to run nuxi dev after upgrading to the latest version of nuxt-edge and nuxt-bridge

Additional context

No response

Logs

Nuxt CLI v3.0.0-27449998.32cf973                                                                                                                                                                                13:20:20
                                                                                                                                                                                                                13:20:20
  > Local:    http://localhost:3000/
  > Network:  http://169.254.139.185:3000/
  > Network:  http://192.168.56.1:3000/
  > Network:  http://192.168.0.129:3000/


 FATAL  Cannot find package '@nuxt/ui-templates' imported from C:\repo\frontend\node_modules\@nuxt\nitro\dist\index.mjs                                                             13:20:23

  at new NodeError (internal/errors.js:322:7)
  at packageResolve (internal/modules/esm/resolve.js:687:9)
  at moduleResolve (internal/modules/esm/resolve.js:728:18)
  at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:842:11)
  at Loader.resolve (internal/modules/esm/loader.js:89:40)
  at Loader.getModuleJob (internal/modules/esm/loader.js:242:28)
  at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:76:40)
  at link (internal/modules/esm/module_job.js:75:36)


 ERROR  Cannot start nuxt:  Cannot find package '@nuxt/ui-templates' imported from C:\repo\frontend\node_modules\@nuxt\nitro\dist\index.mjs                                         13:20:23

  at new NodeError (internal/errors.js:322:7)
  at packageResolve (internal/modules/esm/resolve.js:687:9)
  at moduleResolve (internal/modules/esm/resolve.js:728:18)
  at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:842:11)
  at Loader.resolve (internal/modules/esm/loader.js:89:40)
  at Loader.getModuleJob (internal/modules/esm/loader.js:242:28)
  at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:76:40)
  at link (internal/modules/esm/module_job.js:75:36)


 ERROR  Cannot read property 'callHook' of undefined                                                                                                                                                            13:20:23  

  at Object.invoke (/C:/repo/frontend/node_modules/nuxi/dist/chunks/dev.mjs:6773:31)
  at async _main (/C:/repo/frontend/node_modules/nuxi/dist/chunks/index.mjs:384:7)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

7reactions
heyitsfranklincommented, Mar 11, 2022

Update…

Running npm install -d @nuxt/ui-templates@npm:@nuxt/ui-templates-edge@latest solves the bug.

Can someone please fix this dependency issue?

1reaction
danielroecommented, Mar 21, 2022

This seems to be a general issue with older versions of npm.

The issue here is your version of npm is not installing @nuxt/ui-templates as a dependency of nuxt3 or @nuxt/bridge.

You can verify this by running npm list @nuxt/ui-templates. Here’s sample output.

❯ npm list @nuxt/ui-templates
/tmp/nuxt3-app
└─┬ nuxt3@3.0.0-27460489.53fbca7
  ├─┬ @nuxt/nitro@npm:@nuxt/nitro-edge@3.0.0-27460489.53fbca7
  │ └── @nuxt/ui-templates@npm:@nuxt/ui-templates-edge@0.0.0-27455683.83d2457  (@nuxt/ui-templates) invalid
  └── UNMET DEPENDENCY @nuxt/ui-templates@npm:@nuxt/ui-templates-edge@latest

npm ERR! missing: @nuxt/ui-templates@npm:@nuxt/ui-templates-edge@latest, required by nuxt3@3.0.0-27460489.53fbca7
npm ERR! invalid: @nuxt/ui-templates-edge@0.0.0-27455683.83d2457 /tmp/nuxt3-app/node_modules/@nuxt/nitro/node_modules/@nuxt/ui-templates

Note that it is in nuxt3’s dependencies: https://github.com/nuxt/framework/blob/fb150825ceebbffddd49b312962bef9e6f3ed1b5/packages/nuxt3/package.json#L32-L36

I’m not sure what we can do from a nuxt perspective, but you can either use npm@8 or manually run npm install @nuxt/ui-templates@npm:@nuxt/ui-templates-edge@latest.

Read more comments on GitHub >

github_iconTop Results From Across the Web

@nuxt/ui-templates - npm Package Health Analysis | Snyk
The npm package @nuxt/ui-templates was scanned for known vulnerabilities and missing license, and no issues were found. Thus the package was deemed as...
Read more >
Installation - Nuxt
Here, you will find information on setting up and running a Nuxt project in 4 steps.
Read more >
Error: Cannot find module nuxt.js, why my app don't start?
I´ve got this error when try to run npm run dev after installed the dependencies and i cant find why ...
Read more >
@nuxt/components - npm
Start using @nuxt/components in your project by running `npm i ... TypeScript icon, indicating that this package has built-in type ...
Read more >
cannot find package nuxt/kit imported from - Moringa -
I tried installing the 'missing' package in my home project yet the error ... is not installing @nuxt/ui-templates as a dependency of nuxt3...
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