You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
nix shell "nixpkgs#nodejs"
npx create-next-app@latest test-next-dream
cd test-next-dream
rm -rf node_modules
nix flake init -t github:nix-community/dream2nix#simple
nix eval --impure --raw --expr 'builtins.currentSystem'> ./nix_systems && git add ./nix_systems
nix flake show
nix develop
npm run dev
output of the last command
[bbigras@desktop:~/dev/test-next-dream]$ npm run dev
> [email protected] dev /home/bbigras/dev/test-next-dream
> next dev
internal/modules/cjs/loader.js:905
throw err;
^
Error: Cannot find module 'react'
Require stack:
- /nix/store/bpdi0095q7ww9fy886409cs8mxzjsw6m-next-12.2.2/lib/node_modules/next/dist/server/utils.js
- /nix/store/bpdi0095q7ww9fy886409cs8mxzjsw6m-next-12.2.2/lib/node_modules/next/dist/bin/next
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:101:18)
at Object.<anonymous> (/nix/store/bpdi0095q7ww9fy886409cs8mxzjsw6m-next-12.2.2/lib/node_modules/next/dist/server/utils.js:11:37)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/nix/store/bpdi0095q7ww9fy886409cs8mxzjsw6m-next-12.2.2/lib/node_modules/next/dist/server/utils.js',
'/nix/store/bpdi0095q7ww9fy886409cs8mxzjsw6m-next-12.2.2/lib/node_modules/next/dist/bin/next'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: `next dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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! /home/bbigras/.npm/_logs/2022-07-19T19_30_09_416Z-debug.log
The text was updated successfully, but these errors were encountered:
The reason seems to be a peerDependency issue.
next declares react as a peer dependency, but peer dependencies are not part of the v1part of the lock file.
At least we should raise a warning during build, that peerDependencies are missing, and show a hint on how to fix this with the inject API.
Probably, but it is a huge change which might take a while to stabilize.
For now I already have local changes that fix the devShell problem and improve general interoperability with the npm tool. I just need to make a PR with these changes and the current issue will be fixed.
output of the last command
The text was updated successfully, but these errors were encountered: