在Mac上,我试图遵循Angular.io教程(https://angular.io/tutorial/toh-pt0)中的步骤
$node -v
v8.11.4
$npm -version
6.4.1
$npm install -g @angular/cli
/usr/local/bin/ng -> /usr/local/lib/node_modules/@angular/cli/bin/ng
+ @angular/cli@6.2.3
updated 1 package in 6.533s
$ng new angular-tour-of-heroes
CREATE angular-tour-of-heroes/e2e/src/app.e2e-spec.ts (318 bytes)
CREATE angular-tour-of-heroes/e2e/src/app.po.ts (208 bytes)
npm ERR! Maximum call stack size exceeded
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/XXXXXX/.npm/_logs/2018-09-25T19_56_34_147Z-debug.log
Package install failed, see above.我试过几次了。为什么我总是在运行npm ERR! Maximum call stack size exceeded时得到错误消息ng new angular-tour-of-heroes?
发布于 2018-10-29 17:12:34
最后找到了上述问题的答案-> https://github.com/facebook/create-react-app/issues/5328#issuecomment-429148117
罪魁祸首是位于用户home dir /you/. .npmrc中的.npmrc文件。一旦我删除了文件,一切都好起来了。
发布于 2019-04-07 20:10:07
我也面临着同样的问题。但很长一段时间后,我发现这是因为版本问题。我将节点、npm和角/cli更新到最新版本,然后解决了这个问题。若要更新npm,请使用以下命令
npm install -g npm@latest若要更新角/cli,请使用以下命令
npm uninstall -g angular-cli
npm cache clean (or) npm cache verify (if npm > 5)
npm install @angular/cli@latest从那以后一切都很顺利。谢谢。
发布于 2019-05-18 07:21:52
在Windows 10上也遇到了同样的问题,使用节点-v11.14.0-win-x64zip安装。
在此页中尝试了这两个答案:
不走运。
对我有用的是:
(与再次安装角/cli和类型抄本不同,只需将这些目录从11.14的node_modules复制到10.15以下的目录。
也适用于ng、tsc、tsserver和.cmd文件)
然后新的应用程序就起作用了。因此,在选择节点LTS版本和清理缓存之间,有些事情奏效了。
如果这不管用的话,我就会试试安装纱
https://stackoverflow.com/questions/52505937
复制相似问题