Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ng new demo 时 出现 setTimeout is not defined错误 #168

Open
MuJiamei opened this issue Feb 26, 2021 · 11 comments
Open

ng new demo 时 出现 setTimeout is not defined错误 #168

MuJiamei opened this issue Feb 26, 2021 · 11 comments
Labels
已知的坑,注意避免 已解决 参与者已经有了共识,愿意参与的可继续提问

Comments

@MuJiamei
Copy link

No description provided.

@asnowwolf
Copy link
Contributor

请提供更详细的信息,比如 ng cli 版本,npm registry 设置,或者其它可能比较特别的地方。

@MuJiamei
Copy link
Author

ng cli版本:
Angular CLI: 11.2.2
Node: 10.23.0
OS: darwin x64
npm 版本 6.14.9
ng cli 是通过cnpm下载的 [email protected]
按照官方文档安装步骤安装的,没啥不同啊。。。

@MuJiamei
Copy link
Author

MacBook-Pro-3:angular Albern$ ng new angular1 --strict
? Would you like to add Angular routing? Yes
? Which stylesheet format would you like to use? CSS
setTimeout is not defined

@wszgrcy
Copy link
Collaborator

wszgrcy commented Feb 27, 2021

看起来很正常,尝试升级下Node版本?我记得ng11最低好像需要node12?

@MuJiamei
Copy link
Author

尝试将node升级为v14.16.0 ,还是同样的错误

@MuJiamei
Copy link
Author

npm升级到最新版本也不行

@MuJiamei
Copy link
Author

执行ng --version 显示
Angular CLI: 11.2.2
Node: 14.16.0
OS: darwin x64

Angular:
...
Ivy Workspace:

Package Version

@angular-devkit/architect 0.1102.2 (cli-only)
@angular-devkit/core 11.2.2 (cli-only)
@angular-devkit/schematics 11.2.2 (cli-only)
@schematics/angular 11.2.2 (cli-only)
@schematics/update 0.1102.2 (cli-only)

@MuJiamei
Copy link
Author

我自己找到原因了,原来是用cnpm 安装的原因,我卸载了,重新npm下载了一遍,就可以了

@wszgrcy wszgrcy added 已知的坑,注意避免 已解决 参与者已经有了共识,愿意参与的可继续提问 labels Feb 28, 2021
@greatbear412
Copy link

卸载@angular/cli么?

@wszgrcy
Copy link
Collaborator

wszgrcy commented Mar 10, 2021

卸载@angular/cli么?

就之前的描述,应该是先在全局卸载@angular/cli,然后使用npm重新安装

@MuJiamei
Copy link
Author

就是我之前下载angular/cli是用cnpm下载的,成功下载后创建的项目不可以用,出现如上bug,然后我把之前的angular/cli卸载,重新用npm下载,后就没有问题了,应该是cnpm的软件包的问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
已知的坑,注意避免 已解决 参与者已经有了共识,愿意参与的可继续提问
Projects
None yet
Development

No branches or pull requests

4 participants