最近使用npm打包服务时候总是出现以下错误(内容有删减):
<pre class="console-output" style="box-sizing: border-box; white-space: pre-wrap; overflow-wrap: break-word; margin: 0px; position: relative; font-size: 13px; background: rgb(38, 50, 56); color: rgb(233, 237, 237); cursor: text; font-family: "Roboto Mono", monospace !important; padding: 10px 20px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">�[91mwarning " > webpack-fail-plugin@1.0.6" has incorrect peer dependency "webpack@^1.9.11".
�[0m[5/5] Building fresh packages...
�[91merror /app/node_modules/libxmljs: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: /app/node_modules/libxmljs
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@8.11.4 | linux | x64
gyp http GET [https://nodejs.org/download/release/v8.11.4/node-v8.11.4-headers.tar.gz](https://nodejs.org/download/release/v8.11.4/node-v8.11.4-headers.tar.gz)
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: connect ETIMEDOUT 104.20.22.46:443
gyp ERR! stack at Object._errnoException (util.js:992:11)
gyp ERR! stack at _exceptionWithHostPort (util.js:1014:20)
gyp ERR! stack at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)</pre>
解决方法:
删除~/.node-gyp
即可。
网友评论