Angular 新建组件初级问题!

发布于 2022-09-06 02:52:31 字数 3021 浏览 17 评论 0

node.js,Angular CLI 已经安装。

cnpm install

应该是环境不对吧,各位帮忙指点一下!谢谢(搜不到)
ng g component product1

已经设置了:ng set --global warnings.versionMismatch=false

报错如下:
Your global Angular CLI version (1.4.9) is greater than your local
version (1.4.7). The local Angular CLI version is used.

To disable this warning use "ng set --global warnings.versionMismatch=false".
Error: ELOOP: too many symbolic links encountered, stat 'E:auctionnode_modules@angularclinode_moduleswebpacknode_modulesescopenode_moduleses6-mapnode_modulesdnode_moduleses5-extnode_moduleses6-iterato
rnode_modulesdnode_moduleses5-extnode_moduleses6-iteratornode_modulesdnode_moduleses5-extnode_moduleses6-iteratornode_modulesdnode_moduleses5-extnode_moduleses6-iteratornode_modulesdnode_modules\
es5-extnode_moduleses6-iteratornode_modulesdnode_moduleses5-extnode_moduleses6-iteratornode_modulesdnode_moduleses5-extnode_moduleses6-iteratornode_modulesdnode_moduleses5-extnode_moduleses6-itera
tornode_modulesdnode_moduleses5-extnode_moduleses6-iteratornode_modulesd'


新报错
npm WARN gentlyRm not removing E:auctionnode_modules.binwebdriver-manager.cmd as it wasn't installed by E:auctionnode_moduleswebdriver-manager
npm WARN gentlyRm not removing E:auctionnode_modules.binwebdriver-manager as it wasn't installed by E:auctionnode_moduleswebdriver-manager
npm WARN license-webpack-plugin@1.1.1 requires a peer of webpack-sources@>=1.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN webpack-dev-middleware@1.12.0 requires a peer of webpack@^1.0.0 || ^2.0.0 || ^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules_chokidar@1.7.0@chokidarnode_modulesfsevents):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'E:auctionnode_modules.stagingfsevents-47537c5bnode_modulesabbrev' -> 'E:auctionnode_modules.stagingabbrev-1a5ac37a'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules_chokidar@1.7.0@chokidarnode_modulesfsevents):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename 'E:auctionnode_modules.stagingfsevents-47537c5bnode_modulesabbrev' -> 'E:auctionnode_modules.stagingabbrev-1a5ac37a'

npm ERR! path E:auctionnode_modules@angular-devkitbuild-optimizernode_modulessource-map
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'E:auctionnode_modules@angular-devkitbuild-optimizernode_modulessource-map' -> 'E:auctionnode_modules@angular-devkitbuild-optimizernode_modulessou
rce-map'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR! C:Usersweiming.yangAppDataRoamingnpm-cache_logs2017-10-31T23_51_02_329Z-debug.log

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

始于初秋 2022-09-13 02:52:31

两个问题。

一是Angular Cli全局版本低于项目版本,这个警告可以忽略它,或者升级。

二是,关于 ELOOP: too many symbolic links encountered 的错误,我想应该是 cnpm 引起的,建立使用:

cnpm install --by=npm

或,直接:

npm install
昔日梦未散 2022-09-13 02:52:31

删除node-modules下文件,并清空缓存,然后再使用npm安装

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文