Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

analyze in markdown-blog example does not work with next 5 #22

Open
baba43 opened this issue Mar 29, 2018 · 5 comments
Open

analyze in markdown-blog example does not work with next 5 #22

baba43 opened this issue Mar 29, 2018 · 5 comments

Comments

@baba43
Copy link

baba43 commented Mar 29, 2018

I followed the tutorial with a fresh install and encountered an error when it came to the npm run analyze command. After little investigation, I found that I get the same error after upgrading from next 4 to next 5.1.0.

"C:\Program Files\JetBrains\IntelliJ IDEA 2017.3.2\bin\runnerw.exe" "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" run analyze --scripts-prepend-node-path=auto

> [email protected] analyze D:\dev\learnnextjs-demo
> cross-env ANALYZE=1 next build

Webpack Bundle Analyzer is started at http://127.0.0.1:8888
Use Ctrl+C to close it
events.js:137
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE 127.0.0.1:8888
    at Object._errnoException (util.js:1003:13)
    at _exceptionWithHostPort (util.js:1024:20)
    at Server.setupListenHandle [as _listen2] (net.js:1366:14)
    at listenInCluster (net.js:1407:12)
    at doListen (net.js:1522:7)
    at process._tickCallback (internal/process/next_tick.js:152:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] analyze: `cross-env ANALYZE=1 next build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] analyze 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!     D:\Cache\npm-cache\_logs\2018-03-29T16_40_48_888Z-debug.log
@montionugera
Copy link

montionugera commented Apr 29, 2018

Error: listen EADDRINUSE 127.0.0.1:8888

Kill the application that uses the port 8888

@zebxu
Copy link

zebxu commented Sep 7, 2018

try to change the setting in next.config.js to

new BundleAnalyzerPlugin({
          analyzerMode: 'server',
          analyzerPort: isServer ? 8888 : 8889,
          openAnalyzer: true
        })

add one more port in analyzerPort

@stevaras
Copy link

Happens to me as well. After a few seconds it crashes.
Nothing seems to run on the same port.
Changing port number didn't fix this.

"dependencies": {
    "cross-env": "^5.0.1",
    "express": "^4.15.2",
    "firebase": "^5.7.0",
    "next": "^7.0.2",
    "react": "^16.2.0",
    "react-dom": "^16.2.0",
    "webpack-bundle-analyzer": "^3.0.3"
  }

node: v11.4.0
npm: 6.4.1

The complete log of this run:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'analyze' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'preanalyze', 'analyze', 'postanalyze' ]
5 info lifecycle [email protected]~preanalyze: [email protected]
6 info lifecycle [email protected]~analyze: [email protected]
7 verbose lifecycle [email protected]~analyze: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~analyze: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/stevaras/projects/nextjs/learnnextjs-demo/node_modules/.bin:/home/stevaras/anaconda2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle [email protected]~analyze: CWD: /home/stevaras/projects/nextjs/learnnextjs-demo
10 silly lifecycle [email protected]~analyze: Args: [ '-c', 'cross-env ANALYZE=1 next build' ]
11 silly lifecycle [email protected]~analyze: Returned: code: 1  signal: null
12 info lifecycle [email protected]~analyze: Failed to exec analyze script
13 verbose stack Error: [email protected] analyze: `cross-env ANALYZE=1 next build`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:189:13)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:189:13)
13 verbose stack     at maybeClose (internal/child_process.js:978:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
14 verbose pkgid [email protected]
15 verbose cwd /home/stevaras/projects/nextjs/learnnextjs-demo
16 verbose Linux 4.15.0-42-generic
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "analyze"
18 verbose node v11.4.0
19 verbose npm  v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] analyze: `cross-env ANALYZE=1 next build`
22 error Exit status 1
23 error Failed at the [email protected] analyze script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

@Ishino
Copy link

Ishino commented Jan 3, 2019

running into the same issue

1 verbose cli [ '/usr/local/Cellar/node@8/8.12.0/bin/node',
1 verbose cli   '/usr/local/opt/node@8/bin/npm',
1 verbose cli   'run',
1 verbose cli   'analyze' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'preanalyze', 'analyze', 'postanalyze' ]
5 info lifecycle [email protected]~preanalyze: [email protected]
6 info lifecycle [email protected]~analyze: [email protected]
7 verbose lifecycle [email protected]~analyze: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~analyze: PATH: /usr/local/Cellar/node@8/8.12.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/dries/learnnextjs-demo/node_modules/.bin:/Users/dries/google-cloud-sdk/bin:/usr/local/opt/node@8/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools
9 verbose lifecycle [email protected]~analyze: CWD: /Users/dries/learnnextjs-demo
10 silly lifecycle [email protected]~analyze: Args: [ '-c', 'cross-env ANALYZE=1 next build' ]
11 silly lifecycle [email protected]~analyze: Returned: code: 1  signal: null
12 info lifecycle [email protected]~analyze: Failed to exec analyze script
13 verbose stack Error: [email protected] analyze: `cross-env ANALYZE=1 next build`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/Cellar/node@8/8.12.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at EventEmitter.emit (events.js:214:7)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/Cellar/node@8/8.12.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at ChildProcess.emit (events.js:214:7)
13 verbose stack     at maybeClose (internal/child_process.js:915:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid [email protected]
15 verbose cwd /Users/dries/learnnextjs-demo
16 verbose Darwin 18.2.0
17 verbose argv "/usr/local/Cellar/node@8/8.12.0/bin/node" "/usr/local/opt/node@8/bin/npm" "run" "analyze"
18 verbose node v8.12.0
19 verbose npm  v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] analyze: `cross-env ANALYZE=1 next build`
22 error Exit status 1
23 error Failed at the [email protected] analyze script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]```

@FabienSalles
Copy link

I don't understand the problem but I fixed the issue by modified the config option :
new BundleAnalyzerPlugin({analyzerMode: 'static'})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants