[ERR_MODULE_NOT_FOUND]: Cannot find package 'nanoid'
See original GitHub issueWhat version of Next.js are you using?
12.0.0
What version of Node.js are you using?
14.18.0
What browser are you using?
Chrome
What operating system are you using?
Windows
How are you deploying your application?
next start
Describe the Bug
Importing package ‘nanoid’ causes error:
error - unhandledRejection: Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'nanoid' imported from .next\server\pages\datasets\catalog\[catalog_id].js
Did you mean to import nanoid-npm-3.1.30-58cf6fe7ec-276d0d4b0c.zip/node_modules/nanoid/index.cjs?
package.json dependencies:
"nanoid": "^3.1.30"
Expected Behavior
Successful import
To Reproduce
Occurs when: yarn version 3.1.0 [berry] - without dir node_modules (only /.yarn/cache) and PnP
- yarn dev
- yarn build
Minimal reproduce in https://github.com/mufteev/BUG-debugging-with-new-line-in-template-literals
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Error: Cannot find module 'nanoid/non-secure' - Stack Overflow
Resolved by directly editing postcss entry in package-lock.json to include "nanoid": "^3.2.23" under requires and "nanoid": {"version" ...
Read more >How to resolve can't find module error in Node.js - Reactgo
json file and re-install it again using the npm install command. rm -rf node_modules package-lock.json. Can't find modules in local files.
Read more >Error: Cannot find module 'nanoid-good/generate'-node.js
Coding example for the question "Error: Cannot find module 'nanoid-good/generate'-node.js.
Read more >module-not-found - Next.js
The swr module has to be installed using a package manager. ... The tree shaking only runs on top level pages, so it...
Read more >cannot find module [Node npm Error Solved] - freeCodeCamp
I'm getting the error because I'm trying to import the freeCodeCamp icon from the react-icons package, which I don't have installed. import { ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
See related issue #30393 with a full reproduction, same issue when using highlight.js package.
@balazsorban44 @timneutkens This issue can be closed.