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

run dev failed #1

Closed
urzz opened this issue Dec 18, 2018 · 5 comments
Closed

run dev failed #1

urzz opened this issue Dec 18, 2018 · 5 comments

Comments

@urzz
Copy link

urzz commented Dec 18, 2018

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node',
1 verbose cli   '/usr/lib/node_modules/cnpm/node_modules/.bin/npm',
1 verbose cli   '--userconfig=/home/urzz/.cnpmrc',
1 verbose cli   '--disturl=https://npm.taobao.org/mirrors/node',
1 verbose cli   '--registry=https://registry.npm.taobao.org',
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: /usr/lib/node_modules/cnpm/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/data/server/wakatime-dashboard/node_modules/.bin:/usr/local/bin:/usr/bin:/home/urzz/bin:/usr/local/sbin:/usr/sbin:/usr/java/default/bin:/usr/java/default/jre/bin:/opt/apache-maven/bin
9 verbose lifecycle [email protected]~dev: CWD: /data/server/wakatime-dashboard
10 silly lifecycle [email protected]~dev: Args: [ '-c',
10 silly lifecycle   'webpack-dev-server --mode development --progress --hot --devtool source-map' ]
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: `webpack-dev-server --mode development --progress --hot --devtool source-map`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/cnpm/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at emitTwo (events.js:106:13)
13 verbose stack     at EventEmitter.emit (events.js:191:7)
13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/cnpm/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:106:13)
13 verbose stack     at ChildProcess.emit (events.js:191:7)
13 verbose stack     at maybeClose (internal/child_process.js:920:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
14 verbose pkgid [email protected]
15 verbose cwd /data/server/wakatime-dashboard
16 verbose Linux 3.10.0-957.1.3.el7.x86_64
17 verbose argv "/usr/bin/node" "/usr/lib/node_modules/cnpm/node_modules/.bin/npm" "--userconfig=/home/urzz/.cnpmrc" "--disturl=https://npm.taobao.org/mirrors/node" "--registry=https://registry.npm.taobao.org" "run" "dev"
18 verbose node v6.14.3
19 verbose npm  v6.5.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] dev: `webpack-dev-server --mode development --progress --hot --devtool source-map`
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 ]

node version: v6.14.3

@Magnetic2014
Copy link
Contributor

遇到了同样的问题,请问有解决方法吗?

@Magnetic2014
Copy link
Contributor

参考plotly/dash-component-boilerplate#12 (comment)

This was broken by a webpack update, see webpack/webpack#8082

A workaround for now is to update both, webpack and webpack-cli in package.json:

    "webpack": "^4.20.2",
    "webpack-cli": "^3.1.1",

在package.json的dependencies中加入上述两行,然后重新npm install(为了排除问题,我删除了之前生成的node_modules文件夹),最后再npm run dev就可以使用了,默认端口是3900。

这个方案目前对我有效,你们可以试一试,希望对你们会有帮助~ @urzz @superman66

@superman66
Copy link
Owner

@Magnetic2014 感谢!欢迎提个 PR

Magnetic2014 added a commit to Magnetic2014/wakatime-dashboard that referenced this issue Feb 27, 2019
superman66 added a commit that referenced this issue Mar 3, 2019
fixed issue #1: add missing dependencies
@urzz
Copy link
Author

urzz commented Mar 4, 2019

@superman66 package.json merge之后json parse failed,少了个逗号

Magnetic2014 added a commit to Magnetic2014/wakatime-dashboard that referenced this issue Mar 4, 2019
@Magnetic2014
Copy link
Contributor

@urzz
抱歉,提交前一不小心把逗号删掉了。
补上逗号以后你那里可以正常运行吗?

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

3 participants