0

我正在帮助某人通过在 Windows 7 中运行 npm。执行npm update时,返回以下错误(ENOENT,scandir)。但是npm找不到的文件夹已经验证存在,运行npm的用户对该文件夹有完全权限。以下是此错误的 npm-debug.log 的详细信息:

18265 silly fetchPackageMetaData   errno: -4058,
18265 silly fetchPackageMetaData   code: 'ENOENT',
18265 silly fetchPackageMetaData   syscall: 'scandir',
18265 silly fetchPackageMetaData   path: 'C:\\Users\<\userpath\>\\npm-cache\\_git-remotes\\git-github-com-polymerelements-test-fixture-git-8142662e\\HEAD' }
18266 silly rollbackFailedOptional Starting
18267 silly rollbackFailedOptional Finishing
18268 silly runTopLevelLifecycles Finishing
18269 silly install printInstalled
18270 verbose stack Error: ENOENT: no such file or directory, scandir 'C:\Users\\<userpath\>\npm-cache\_git-remotes\git-github-com-polymerelements-test-fixture-git-8142662e\HEAD'
18271 verbose cwd C:\Users\\<userpath\>\git\PredixDev\predix-seed
18272 error Windows_NT 6.1.7601
18273 error argv "G:\\nodejs\\node.exe" "G:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "update" "--no-optional"
18274 error node v7.2.0
18275 error npm  v3.10.9
18276 error path C:\Users\\<userpath\>\npm-cache\_git-remotes\git-github-com-polymerelements-test-fixture-git-8142662e\HEAD
18277 error code ENOENT
18278 error errno -4058
18279 error syscall scandir
18280 error enoent ENOENT: no such file or directory, scandir 'C:\Users\\<userpath\>\npm-cache\_git-remotes\git-github-com-polymerelements-test-fixture-git-8142662e\HEAD'
18281 error enoent ENOENT: no such file or directory, scandir 'C:\Users\\<userpath\>\npm-cache\_git-remotes\git-github-com-polymerelements-test-fixture-git-8142662e\HEAD'
18281 error enoent This is most likely not a problem with npm itself
18281 error enoent and is related to npm not being able to find a file.
18282 verbose exit [ -4058, true ]

我对在 Windows 上使用 Node 一点也不熟悉。请帮忙,谢谢。(注意:我已将上面的特定用户文件夹信息替换为 \ 以清理信息。)

4

1 回答 1

0

一个可能的原因是过滤对文件系统的访问的安全软件,如 DigitalGuardian。如果它是安装了类似设备的公司机器,您可能需要让您的 IT 人员将 Node.js 列入白名单。

https://github.com/npm/npm/issues/10729

于 2017-01-09T20:46:10.510 回答