简体   繁体   English

npm run start 后构建卡在 91%

[英]Build gets stuck at 91% after npm run start

All of a sudden this error appeared when I did npm run start.当我执行 npm run start 时,突然出现了这个错误。 The project is built with ant-design pro.该项目是用 ant-design pro 构建的。 The sad part is that it doesn't tell me where the error is.可悲的是它没有告诉我错误在哪里。 Could you help me find the error or to fix it.你能帮我找出错误或修复它吗? The build just gets stuck at 91% and then I get the error message.构建只是停留在 91%,然后我收到错误消息。

Here's the error:这是错误:

 build [==================  ] 91%(node:6978) UnhandledPromiseRejectionWarning: RangeError: Invalid string length
    at formatError (/home/teks/trips/may26th/smarttrips_react/node_modules/webpack/lib/Stats.js:223:30)
    at Array.map (<anonymous>)
    at Stats.toJson (/home/teks/trips/may26th/smarttrips_react/node_modules/webpack/lib/Stats.js:230:31)
    at Compiler.<anonymous> (/home/teks/trips/may26th/smarttrips_react/node_modules/html-webpack-plugin/index.js:68:44)
    at Compiler.applyPluginsAsyncSeries (/home/teks/trips/may26th/smarttrips_react/node_modules/tapable/lib/Tapable.js:206:13)
    at Compiler.emitAssets (/home/teks/trips/may26th/smarttrips_react/node_modules/webpack/lib/Compiler.js:354:8)
    at onCompiled (/home/teks/trips/may26th/smarttrips_react/node_modules/webpack/lib/Compiler.js:58:19)
    at applyPluginsAsync.err (/home/teks/trips/may26th/smarttrips_react/node_modules/webpack/lib/Compiler.js:510:14)
    at next (/home/teks/trips/may26th/smarttrips_react/node_modules/tapable/lib/Tapable.js:202:11)
    at Compiler.<anonymous> (/home/teks/trips/may26th/smarttrips_react/node_modules/webpack/lib/CachePlugin.js:78:5)
    at next (/home/teks/trips/may26th/smarttrips_react/node_modules/tapable/lib/Tapable.js:204:14)
    at /home/teks/trips/may26th/smarttrips_react/node_modules/hard-source-webpack-plugin/index.js:2075:7
    at <anonymous>
(node:6978) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:6978) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

EDIT : I also updated my npm to ver 6 but still get the same error message.编辑:我还将我的 npm 更新到版本 6,但仍然收到相同的错误消息。 please advise.请指教。

Well, I had been searching and now I found an issue posted which helped me out.好吧,我一直在搜索,现在我发现了一个帮助我解决的问题。 Basically, adding this code to my package.json is what helped me out.基本上,将此代码添加到我的 package.json 对我有所帮助。

"start": "HARD_SOURCE=none npm run _start", "_start": "cross-env ESLINT=none roadhog dev",

I couldnt understand much more of why as it was written in chinese, Anyways, here's the link to the github issue as it may help some of you understand what was wrong.我无法理解为什么它是用中文写的,无论如何,这是 github 问题的链接,因为它可能会帮助你们中的一些人了解哪里出了问题。 antdesign github issue fixed here antdesign github 问题在这里修复

It might be coz the localhost is not defined with the required syntax in the "hosts" file of the system.可能是因为localhost没有在系统的“hosts”文件中使用所需的语法定义。 The file can be located @:该文件可以位于@:

linux linux

etc/hosts

Windows视窗

c:\\ **Windows** \\System32\\Drivers\\ **etc** \\ **hosts**

ie file has some wrong input.即文件有一些错误的输入。

So, Try replacing everything in that file with the text below as this is the default text that was always there in hosts file when it worked fine:因此,请尝试用下面的文本替换该文件中的所有内容,因为这是在主机文件正常工作时始终存在的默认文本:

127.0.0.1   localhost

255.255.255.255 broadcasthost

::1             localhost

fe80::1%lo0 localhost

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM