问题描述
我在谷歌上搜索了这个问题的答案,但解决方案"没有.在我的情况下似乎缺少一些东西.我只是尝试在 Windows 10 上将 yarn.js 更新到版本 2.升级过程的一部分要我先升级 npm 全局模块.运行:
I have googled for the answer to this but the "solutions" seem to be missing something in my case. I just tried to update yarn.js to version 2 on Windows 10. Part of the upgrade process wants me to upgrade npm global modules first. running:
npm update -g
作为管理员或我自己给我:
as admin or myself gives me:
$ npm update -g
npm ERR! code ELOOP
npm ERR! syscall stat
npm ERR! path \\fs2.my.company.com\Home\
npm ERR! errno -62
npm ERR! ELOOP: too many symbolic links encountered, stat '\\fs2.my.company.com\Home\'
npm ERR! A complete log of this run can be found in:
npm ERR! \\fs2.my.company.com\Home\MyAccount\AppData\Roaming\npm-cache\_logs\2020-12-09T17_30_03_007Z-debug.log
引用的日志文件包含:
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'update',
1 verbose cli '-g'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session a666bee41aec0454
5 verbose update computing outdated modules to update
6 verbose stack Error: ELOOP: too many symbolic links encountered, stat '\\fs2.my.company.com\Home\'
6 verbose stack at eloop (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:58:17)
6 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:19:11)
6 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:39:10)
6 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:39:10)
6 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:39:10)
6 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:39:10)
6 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:39:10)
6 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:39:10)
6 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:39:10)
6 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:39:10)
6 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:39:10)
6 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:39:10)
6 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:39:10)
6 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:39:10)
6 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:39:10)
6 verbose stack at realpathCached (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-tree\realpath.js:39:10)
7 verbose cwd C:\Users\MyAccount
8 verbose Windows_NT 10.0.17763
9 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "update" "-g"
10 verbose node v14.15.1
11 verbose npm v6.14.8
12 error code ELOOP
13 error syscall stat
14 error path \\fs2.my.company.com\Home\
15 error errno -62
16 error ELOOP: too many symbolic links encountered, stat '\\fs2.my.company.com\Home\'
17 verbose exit [ -62, true ]
我看到的其他报告表明 node_modules
文件夹中有一个损坏的文件.我已经卸载了 yarn 和 node(加上 npm),并寻找并删除了与它们相关的 App_Data 文件夹.此时我已经重新安装了 nodejs,所以一切应该都是纯净的.
The other reports of this I have seen suggest that there is a corrupt file in a node_modules
folder. I have uninstalled yarn, and node (plus npm) and have hunted for and removed App_Data folders related to them. I have reinstalled nodejs at this point so everything should be pure.
我错过了什么?
推荐答案
我很确定问题是 npm
相关缓存和关联文件指向的位置是已安装的文件系统在 Windows 10 上.我发现可以创建一个 .npmrc
文件并指定/覆盖许多配置项的默认值.我在其中设置了 prefix
和 cache
路径以指向我本地机器上的文件夹.
I am pretty sure the issue was that the npm
related cache and associated files were pointing to a location that is a mounted file system on Windows 10. I have discovered that one can create a .npmrc
file and specify/override default values for a lot of config items. I set the prefix
and cache
paths in there to point to folders on my local machine.
我现在遇到了其他问题,但这个问题似乎已经解决了.
I am having other issues now but this one seems closed.
干杯
这篇关于全新安装的 npm 会生成“ELOOP:符号链接太多"错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!