Next.js: Errors when trying the minimal setup

Created on 31 Dec 2016  路  11Comments  路  Source: vercel/next.js

The minimal setup at the beginning of
https://zeit.co/blog/next

seems to generate cryptic errors:

ERROR  Failed to compile with 4 errors

These dependencies were not found in node_modules:

* ./pages/index.js?entry
* /Users/dmitrizaitsev/Dropbox/Sandbox/nextjs-test/node_modules/next/dist/pages/_error.js?entry
* /Users/dmitrizaitsev/Dropbox/Sandbox/nextjs-test/node_modules/next/dist/pages/_error-debug.js?entry
* /Users/dmitrizaitsev/Dropbox/Sandbox/nextjs-test/node_modules/next/dist/pages/_document.js?entry

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

npm install does not help :(

bug

All 11 comments

It looks weird. Let me know how your project directory looks like.

Here is the clone of my directory:

https://github.com/dmitriz/nextjs-test

@dmitriz could you tell us your dev env?

  • OS
  • Node version
  • NPM version

@arunoda Same as me after upgrade to v2.0.0-beta6

macOS 10.12.2
[email protected]
[email protected]

When I run next build. I saw an error like this:

Module not found: Error: Can't resolve 'babel-loader'

And I change webpack config as below then resolve it.

webpack: (config, { dev }) => {
    config.resolveLoader.modules.push(path.join(process.cwd(), 'node_modules'))
    return config
}

Maybe this is a difference between webpack@1 and webpack@2.

node -v; npm -v
v6.9.2
4.0.5

Mac OSX 10.8.5

@nkzawa this happens when we install it from NPM or via file:///.
Works with npm link.

@cncolder Thanks for the hint.
Yep. It was the issue.

I've added app's node modules dir into resolve loaders by default via #583.
It'll fix this issue.

Guys, try: [email protected]

@arunoda Yes, it fix for me...

Works now!

Many thanks for fixing it so quick!

Was this page helpful?
0 / 5 - 0 ratings