当我使用Ionic serve命令运行Ionic 3项目时,我会得到这个错误:
当前回答
在我的案例中,我通过安装Node.js 12.10.0版本解决了这个问题。
其他回答
我没有使用ng build,而是在终端中执行以下命令来修复这个问题。
node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng build --prod
那就发球吧。
这就是我的终端机
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
PS D:\ProjectPath\Project1> node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng build --prod
node --max_old_space_size=4096 node_modules/@angular/cli/bin/ng build --baseHref=/baseUrl/ --prod=true
由于某些原因,之前所有的答案对我都不起作用。我做了以下来解决我的问题:
我必须首先删除node_modules文件夹 在我的电脑上重新安装Node.js 然后安装NPM
对我来说,这是一个Firebase包的问题。
在你的包中只添加"@firebase/database": "0.2.1"。json文件。重新安装node_modules,它就可以工作了。
在我的例子中,错误是由于在for中不恰当地使用条件引起的。循环。而不是:
for (let t = startNo; t <= endNo; t++) {}
我有:
for (let t = startNo; endNo; t++) {}