1

我无法安装 webpack-dev-server:

npm install -g webpack-dev-server

我得到:

gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
npm ERR! Failed at the bufferutil@1.2.1 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the bufferutil package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls bufferutil
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR!     D:\...\npm-debug.log

我需要安装python吗?我怎样才能完成它?bufferutil 包有问题吗?

4

2 回答 2

0

您可以尝试在没有安装后脚本 ( npm i -g webpack-dev-server --ignore-scripts) 的情况下安装它。它将以这种方式工作。

于 2015-11-22T19:02:44.313 回答
0

与工作中的朋友交谈,这不是问题。我们根本不需要 Python。

我会更多地研究这个。到目前为止,我已经安装并运行了,但我的不太好用。它尝试加载页面,然后失败并出现关于组合器的单个警告。

/deep/ combinator is deprecated. See https://www.chromestatus.com/features/6750456638341120 for more details.

这是我遇到的问题和修复的小时间表,以使其正常工作。重新加载似乎比我想象的要慢得多!

 1. 

Problem: Stuck pulling http://localhost:8080/webpack-dev-server/

fix: http://127.0.0.1:8080/

 2. 

Problem: which didn't allow for watch to reupdate

Fix:  change entry in webpack.config.js to entry: [
    "./app.js",
    'webpack/hot/only-dev-server', ] and include 
        <script src="https://localhost:8080/webpack-dev-server.js"></script> to the index.html and run webpack-dev-server --inline

 3. 

Problem: Then started getting: Errors while compiling. App updated with errors. No reload!     multi main Module not found: Error: Cannot resolve module 'webpack/hot/only-dev-server' in C:\Users\KRebstock\Desktop\reactexamples\webpack example1 resolve module webpack/hot/only-dev-server in C:\Users\KRebstock\Desktop\reactexamples\webpack example1  @ multi main

Fix:   removed
     'webpack/hot/only-dev-server', from  webpackage.config.js  in  entry: ["bla","bla"]
于 2015-10-02T19:17:19.840 回答