Next.js: Error when running NextJS example "Using With Router"

Created on 4 Sep 2017  路  2Comments  路  Source: vercel/next.js


I downloaded the example located here:

https://github.com/zeit/next.js/tree/master/examples/using-with-router

And after installing dependencies and running npm run dev I received an error:

screen shot 2017-09-04 at 12 08 44 pm

I'm running on MacOS 10.12.6 (Sierra)

The error occurs after dependencies are installed and starting next via npm run dev:

> [email protected] dev /Users/jake-wies/Desktop/home/Code/sandbox/using-with-router
> next

internal/child_process.js:325
    throw errnoException(err, 'spawn');
    ^

Error: spawn EACCES
    at _errnoException (util.js:1022:11)
    at ChildProcess.spawn (internal/child_process.js:325:11)
    at Object.exports.spawn (child_process.js:493:9)
    at spawn (/Users/jake-wies/Desktop/home/Code/sandbox/using-with-router/node_modules/cross-spawn/index.js:17:18)
    at startProcess (/Users/jake-wies/Desktop/home/Code/sandbox/using-with-router/node_modules/next/dist/bin/next:69:36)
    at Object.<anonymous> (/Users/jake-wies/Desktop/home/Code/sandbox/using-with-router/node_modules/next/dist/bin/next:90:12)
    at Module._compile (module.js:573:30)
    at Object.Module._extensions..js (module.js:584:10)
    at Module.load (module.js:507:32)
    at tryModuleLoad (module.js:470:12)

I was directed to this example inside the Zeit community slack as feedback for a question I asked regarding styling active Links uniquely.

Edit:

Here is the complete log after the error was thrown:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/8.3.0/bin/node',
1 verbose cli   '/Users/jake-wies/.npm-packages/bin/npm',
1 verbose cli   'run',
1 verbose cli   'dev' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle [email protected]~predev: [email protected]
6 info lifecycle [email protected]~dev: [email protected]
7 verbose lifecycle [email protected]~dev: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~dev: PATH: /Users/jake-wies/.npm-packages/lib/node_modules/npm/bin/node-gyp-bin:/Users/jake-wies/Desktop/home/Code/sandbox/using-with-router/node_modules/.bin:/Users/jake-wies/.npm-packages/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/jake-wies/.npm-packages/bin
9 verbose lifecycle [email protected]~dev: CWD: /Users/jake-wies/Desktop/home/Code/sandbox/using-with-router
10 silly lifecycle [email protected]~dev: Args: [ '-c', 'next' ]
11 silly lifecycle [email protected]~dev: Returned: code: 1  signal: null
12 info lifecycle [email protected]~dev: Failed to exec dev script
13 verbose stack Error: [email protected] dev: `next`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/Users/jake-wies/.npm-packages/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16)
13 verbose stack     at emitTwo (events.js:125:13)
13 verbose stack     at EventEmitter.emit (events.js:213:7)
13 verbose stack     at ChildProcess.<anonymous> (/Users/jake-wies/.npm-packages/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:125:13)
13 verbose stack     at ChildProcess.emit (events.js:213:7)
13 verbose stack     at maybeClose (internal/child_process.js:927:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
14 verbose pkgid [email protected]
15 verbose cwd /Users/jake-wies/Desktop/home/Code/sandbox/using-with-router
16 verbose Darwin 16.7.0
17 verbose argv "/usr/local/Cellar/node/8.3.0/bin/node" "/Users/jake-wies/.npm-packages/bin/npm" "run" "dev"
18 verbose node v8.3.0
19 verbose npm  v5.4.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] dev: `next`
22 error Exit status 1
23 error Failed at the [email protected] dev script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Most helpful comment

npm 5.4.0 for some reason does not allow to run to react properly.
Install npm 5.3.0 with -> sudo npm install -g [email protected]

All 2 comments

npm 5.4.0 for some reason does not allow to run to react properly.
Install npm 5.3.0 with -> sudo npm install -g [email protected]

I also had to reinstall node_modules to get it to work. Any thought as to why this is happening with npm 5.3.0, seems like a strange issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

YarivGilad picture YarivGilad  路  3Comments

wagerfield picture wagerfield  路  3Comments

rauchg picture rauchg  路  3Comments

sospedra picture sospedra  路  3Comments

pie6k picture pie6k  路  3Comments