简体   繁体   English

NPM损坏并报告此错误:npm ERR! 404

[英]NPM broken and reporting this error: npm ERR! 404

I am running npm update -g and I get 我正在运行npm update -g并且得到

npm ERR! code E404
npm ERR! 404 Not found : default-html-example
npm ERR! 404
npm ERR! 404  'default-html-example' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/me/.npm/_logs/2018-10-25T22_24_12_353Z-debug.log

So, I get this after any command now, for example in any project, when I run ./node_modules/.bin/eslin . 因此,当我运行./node_modules/.bin/eslin .时,例如在任何项目中,我现在都可以在任何命令之后得到它./node_modules/.bin/eslin . I get the linter results, but at the end of the verbose there is always this error. 我得到了棉短绒的结果,但是在冗长的末尾总会出现此错误。

--- UPDATE --- -更新-

Upon further investigation, I have found this. 经过进一步调查,我发现了这一点。

  • Something called /usr/local/lib/node_modules/default-html-example 称为/usr/local/lib/node_modules/default-html-example
  • This is something I have worked on as an example as part of one of my first tutorials. 在我的第一批教程之一中,这就是我作为示例进行的工作。 Not sure about how on earth it ended up there. 不确定它到底是如何到达那里的。
  • When I checked it, it turns out it is a symlink to a tutorial: default-html-example -> /Users/me/learning/lynda_com_JavaScript_Essential_Training/MY_Ex_Files_JavaScript_EssT/Exercise_Files/default 当我检查它时,事实证明它是一个教程的符号链接: default-html-example -> /Users/me/learning/lynda_com_JavaScript_Essential_Training/MY_Ex_Files_JavaScript_EssT/Exercise_Files/default

This is still a mystery, how it ended up there? 这仍然是一个谜,它如何最终到那里?

Finding and removing that rogue folder /usr/local/lib/node_modules/default-html-example solved the issue. 查找并删除该恶意文件夹/usr/local/lib/node_modules/default-html-example解决了该问题。

However, I am still not sure how that folder ended up in that location. 但是,我仍然不确定该文件夹如何在该位置结束。 It was one of my first tutorial project folders. 这是我的第一个教程项目文件夹之一。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM