webpackForSPA
webpackForSPA copied to clipboard
npm-debug.log
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'dev-hrm' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'predev-hrm', 'dev-hrm', 'postdev-hrm' ]
5 info lifecycle [email protected]~predev-hrm: [email protected]
6 silly lifecycle [email protected]~predev-hrm: no script for predev-hrm, continuing
7 info lifecycle [email protected]~dev-hrm: [email protected]
8 verbose lifecycle [email protected]~dev-hrm: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]~dev-hrm: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;E:\webpack\webpackForSPA\node_modules.bin;C:\Program Files\nodejs;D:\RailsInstaller\Git\cmd;D:\RailsInstaller\Ruby2.2.0\bin;C:\Program Files (x86)\Common Files\NetSarang;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files (x86)\AMD\ATI.ACE\Core-Static;C:\Java\jdk1.7.0_79\bin;D:\mysql-5.6.27-winx64\bin;D:\apache-maven-3.2.3\bin;D:\Program Files (x86)\IDM Computer Solutions\UltraEdit;C:\Program Files (x86)\IDM Computer Solutions\UltraCompare;D:\tomcat\apache-tomcat-7.0.62\bin;D:\apache-ant-1.9.6\bin;D:\nodejs\node_global\node_modules;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Python27;C:\Program Files\nodejs;C:\Program Files (x86)\IDM Computer Solutions\UltraCompare;C:\Users\Administrator\AppData\Roaming\npm
10 verbose lifecycle [email protected]~dev-hrm: CWD: E:\webpack\webpackForSPA
11 silly lifecycle [email protected]~dev-hrm: Args: [ '/d /s /c', 'webpack-dev-server --config' ]
12 silly lifecycle [email protected]~dev-hrm: Returned: code: 1 signal: null
13 info lifecycle [email protected]~dev-hrm: Failed to exec dev-hrm script
14 verbose stack Error: [email protected] dev-hrm: webpack-dev-server --config
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.webpack-dev-server --config
22 error Exit status 1
23 error Failed at the [email protected] dev-hrm script 'webpack-dev-server --config'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the webpackforspa package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error webpack-dev-server --config
23 error You can get information on how to open an issue for this project with:
23 error npm bugs webpackforspa
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls webpackforspa
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
我运行npm run dev-hrm就出现上面的结果。
@tuxiantian 你好,我猜测这个错误的导致原因可能是你的nodejs 或者 npm 版本过低导致的。你可以尝试以下操作:
1、更新npm ,命令: npm install npm -g
2、nodejs 更新 需要到nodejs 官网下载重新安装 https://nodejs.org/en/
如果不是nodejs或者npm 版本问题请留言给我
应该不是nodejs或者npm版本问题
@tuxiantian
可能是你的8080 端口被占用了,将webpack.config.js 中配置的热更新启动端口,和浏览器自动打开的端口改为其他未被占用的端口试下。
就是下图中的这两处,比如都改为8000端口:
@tuxiantian 你是否在把代码克隆下来后修改了某些文件,比如webpack.config.js 配置,或者项目的启动index.js 文件。 我刚才就是把项目clone 下来,重新运行的,是没问题的。你再确认下
我没有修改任何文件,按你的指示操作的,可还是报上面的错误。
在安装依赖的包时是否有报错信息? 如果有你重新把依赖的包安装一次: npm install
(记录下是否有报错信息)
有3个警告,并没有报错信息。
我认为可能原因是open-browser-webpack-plugin这个插件有问题。我在webpack.config.js中把这个插件去了,然后手动在浏览器地址栏输入http://localhost:8080/webpackForSPA/dist/index.html能够正常访问页面。但让我疑惑的是并未在项目目录下看见dist目录。
热更新模式不会产生文件,会在内存中操作。其他模式可以在dist目录下看到生成的文件
@tuxiantian 我想应该不是“open-browser-webpack-plugin”的问题,因为我昨天重新克隆,重新安装运行的,都是没问题。 刚刚我把webpack.config.js自动打开浏览器的配置路径多打了一个空格,出现了和你类似的错误提示。就是这里:
plugins: [
// Enable multi-pass compilation for enhanced performance
// in larger projects. Good default.
new webpack.HotModuleReplacementPlugin({
multiStep: true
}),
new OpenBrowserPlugin({url: 'http://localhost:8080' + PATHS.publicPath + 'index.html'})
],
你可以把这个地方重新覆盖到你的webpack.config.js 试下
我拷贝你的代码覆盖webpack.config.js相应位置的代码,依然是上面的问题。而且我发现你贴出来的代码和项目上的配置代码是一样的。
因为我觉得可能是你改动了这个地方,就把原项目里的拷贝给你。看样不是这个问题。 其他模式运行正常吗? npm run dev 和 npm run build
很抱歉,到现在为止你的问题我不能重现。 如果我这边有了新进展会回复你
webpack是一门很有用的技术,你这个示例项目设计的很好。你能把它贡献出来供我这个新手学习,真的很感激。至于出现的问题,那也是瑕不掩瑜。你能及时回复,真是一个热心的人。相信你的项目一定会聚集更多的人气。
From: huangshuwei Date: 2016-07-17 10:40 To: huangshuwei/webpackForSPA CC: tuxiantian; Mention Subject: Re: [huangshuwei/webpackForSPA] npm-debug.log (#1) 很抱歉,到现在为止你的问题我不能重现。 如果我这边有了新进展会回复你 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
@tuxiantian 谢谢。作为技术人,除了不断地学习能够快速提升自己的技术能力,讨论、和分享都会给自己带来不一样的提升。github 本来就是一个提供分享的地方。
npm run dev和 npm run build都是可以正常打包的。