场景:在没有通过npm init初始化目录的情况下,直接通过cnpm命令安装模块,在卸载模块时报错

报错:name cannot start with an underscore; name can only contain URL-friendly characters

原因分析:通过cnpm命令安装模块时,会同时生成带下划线的文件(eg: _jquery@3.4.1@jquery),不符合命名规范(根据报错提示)

解决方案:

  方案一:安装模块时用npm,非cnpm

  方案二:先通过npm init初始化目录,生成包管理文件package.json,再安装模块(npm/cnpm)  

 

npm卸载模块报错

 

 

相关文章:

  • 2022-12-23
  • 2021-11-20
  • 2022-02-24
  • 2022-12-23
  • 2021-10-02
  • 2021-10-28
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案