npm - tarball data for material-design-icons seems to be corrupted

我是研究僧i 提交于 2020-01-12 19:05:47

问题


I'm having this error while running a npm install material-design-icons@3.0.1:

tarball data for material-design-icons@3.0.1 (sha1-mnHEh0chjrylHlGmbaaCA4zct78=) seems to be corrupted
npm ERR! path D:\speech-analytics\node_modules\.staging\material-design-icons-7d5a1f73\action\drawable-xxhdpi\ic_assignment_ind_white_48dp.png
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'D:\\speech-analytics\node_modules\.staging\material-design-icons-7d5a1f73\action\drawable-xxhdpi\ic_assignment_ind_white_48dp.png'
npm ERR!  { Error: EPERM: operation not permitted, unlink 'D:\\speech-analytics\node_modules\.staging\material-design-icons-7d5a1f73\action\drawable-xxhdpi\ic_assignment_ind_white_48dp.png'

Here it's documented as a bug, but still without an answer nor a fix.

I've tried to reinstall node, upgraded to latest npm version (currently running 6.4.1), did a cache clean --force, tried a npm install --no-optional, removed package-lock.json, removed npm & npm-cache folders from AppData directory, running everything as Administrator, but still no luck.

I even tried with material-design-icons@3.0.0 but the error remains.

If I navigate to the folder that appears in the log (node_modules\.staging\material-design-icons-7d5a1f73\action\drawable-xxhdpi), it's empty, and is the only folder that exists in the entire node_modules directory. I can delete that dir without any problems, so it does not seem to be a permissions/lock issue.

Any suggestions?


回答1:


Finally, I got this fixed by:

  • Removing node_modules folder
  • Running npm update
  • Running npm install

As far I understand, the npm update should have updated the package.json file, but all dependencies kept the same versions as we had it before.




回答2:


I resolved this with the command: npm cache verify which output:

Cache verified and compressed (C:\Programs\DCPS\npm-cache\_cacache):
Content verified: 1344 (164824963 bytes)
Content garbage-collected: 1 (3491551 bytes)
Index entries: 1522
Finished in 8.187s

The line that stands out to me is: Content garbage-collected: 1 (3491551 bytes)

Does this sort of thing happen because a new version of a package is published to npmjs without a version bump?



来源:https://stackoverflow.com/questions/52739973/npm-tarball-data-for-material-design-icons-seems-to-be-corrupted

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!