我无法从 npm 安装 npm 模块,为什么?

Muh*_*mzy 2 node.js npm

每当我使用安装一些 npm 模块时,它都会显示相同的错误

例如:当我输入时,npm install express它会显示如下错误:-

npm ERR! code ERR_OSSL_PEM_NO_START_LINE
npm ERR! error:0909006C:PEM routines:get_name:no start line
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\mhdra\AppData\Local\npm-cache\_logs\2021-01-14T02_04_52_493Z-debug.log
Run Code Online (Sandbox Code Playgroud)

但是当我尝试使用它清理 npm 缓存时,npm clean cache --force它会显示一些错误,例如:-

 npm WARN using --force Recommended protections disabled.
Run Code Online (Sandbox Code Playgroud)

小智 6

  1. 尝试npm cache clean --force
  2. 手动删除它 - 输入 Windows 搜索 - 运行 - %appdata% - 删除 npm-cache 文件夹
  3. 重新安装节点应该可以解决所有问题。

  • `npm 警告使用 --force 建议的保护已禁用。` (4认同)