Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 在npm运行开始后,构建将停留在91%_Node.js_Reactjs_Antd - Fatal编程技术网

Node.js 在npm运行开始后,构建将停留在91%

Node.js 在npm运行开始后,构建将停留在91%,node.js,reactjs,antd,Node.js,Reactjs,Antd,当我执行npm运行start时,突然出现了这个错误。 该项目是由ant design pro构建的。 可悲的是,它没有告诉我错误在哪里。 你能帮我找到这个错误还是帮我改正。 构建只是停留在91%,然后我得到了错误消息 以下是错误: build [================== ] 91%(node:6978) UnhandledPromiseRejectionWarning: RangeError: Invalid string length at formatError (/

当我执行npm运行start时,突然出现了这个错误。 该项目是由ant design pro构建的。 可悲的是,它没有告诉我错误在哪里。 你能帮我找到这个错误还是帮我改正。 构建只是停留在91%,然后我得到了错误消息

以下是错误:

 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.
build[======================]91%(节点:6978)未处理PromisejectionWarning:RangeError:字符串长度无效
格式错误(/home/teks/trips/may26/smarttrips\u react/node\u modules/webpack/lib/Stats.js:223:30)
在Array.map()处
在Stats.toJson(/home/teks/trips/may26/smarttrips\u react/node\u modules/webpack/lib/Stats.js:230:31)
在编译器上。(/home/teks/trips/may26/smarttrips\u react/node\u modules/html网页插件/index.js:68:44)
在Compiler.applypluginasyncSeries(/home/teks/trips/may26/smarttrips\u react/node\u modules/tapable/lib/tapable.js:206:13)
在Compiler.emitAssets(/home/teks/trips/may26/smarttrips\u react/node\u modules/webpack/lib/Compiler.js:354:8)
在未编译时(/home/teks/trips/may26/smarttrips\u react/node\u modules/webpack/lib/Compiler.js:58:19)
在applypluginasync.err(/home/teks/trips/may26/smarttrips\u react/node\u modules/webpack/lib/Compiler.js:510:14)
接下来(/home/teks/trips/may26/smarttrips\u react/node\u modules/tapable/lib/tapable.js:202:11)
在编译器上。(/home/teks/trips/may26/smarttrips\u react/node\u modules/webpack/lib/CachePlugin.js:78:5)
接下来(/home/teks/trips/may26/smarttrips\u react/node\u modules/tapable/lib/tapable.js:204:14)
at/home/teks/trips/may26/smarttrips\u react/node\u modules/hard source webpack plugin/index.js:2075:7
在
(节点:6978)未处理的PromisejectionWarning:未处理的承诺拒绝。此错误源于在没有catch块的异步函数中抛出,或者拒绝未使用.catch()处理的承诺。(拒绝id:1)
(节点:6978)[DEP0018]弃用警告:未处理的承诺拒绝已弃用。将来,未处理的承诺拒绝将使用非零退出代码终止Node.js进程。

编辑:我也将我的npm更新到第6版,但仍然收到相同的错误消息。请告知。

好吧,我一直在搜索,现在我发现了一个帮助我解决问题的帖子。 基本上,将此代码添加到我的package.json中对我有帮助

"start": "HARD_SOURCE=none npm run _start", "_start": "cross-env ESLINT=none roadhog dev",
我无法理解为什么它是用中文写的, 无论如何,这里是github问题的链接,因为它可能会帮助你们中的一些人理解问题所在。
这可能是因为系统的“hosts”文件中未使用所需语法定义本地主机。 该文件可以位于@:

linux

etc/hosts

窗口

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

i、 文件有一些错误的输入

因此,请尝试用以下文本替换该文件中的所有内容,因为这是主机文件正常工作时始终存在的默认文本:

127.0.0.1   localhost

255.255.255.255 broadcasthost

::1             localhost

fe80::1%lo0 localhost

好啊让我试试