Skip to content

next.js fails when installed as a dependency with npm link #699

@reel

Description

@reel

If I install next.js as a dependency of a module, then npm link that module and try to use it in another project, I get the following error:

 ERROR  Failed to compile with 6 errors

These dependencies were not found in node_modules:

* ./pages/a.js?entry
* ./pages/b.js?entry
* ./pages/index.js?entry
* C:\Users\user\code\next-as-deps\with-next\node_modules\next\dist\pages\_error.js?entry
* C:\Users\user\code\next-as-deps\with-next\node_modules\next\dist\pages\_error-debug.js?entry
* C:\Users\user\code\next-as-deps\with-next\node_modules\next\dist\pages\_document.js?entry

Did you forget to run npm install --save for them?
> Ready on http://localhost:3000

I made a full reproduction in this repo: https://github.com/reel/next-as-deps

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions