跟往常一样运行npm install 的时候,突然报错。错误情况如下:

npm ERR! Cannot read property 'match' of undefined

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user\AppData\Roaming\npm-cache\_logs\2018-08-06T01_49_46_486Z-debug.log

查找了很多的方法,有人说清楚npm本地缓存(npm cache clear --force),我都试过了,还是报错。。
最后删了项目文件夹下面的package-lock.json,然后再运行npm install便可正常的安装了~~~

如果还是不行的话,那就一条条执行下面这四条命令吧~~~

1 rm -rf node_modules
2 rm package-lock.json
3 npm cache clear --force
4 npm install

 

相关文章:

  • 2021-05-26
  • 2021-10-17
  • 2021-09-16
  • 2021-04-28
  • 2021-09-11
  • 2021-11-22
  • 2021-07-09
  • 2021-12-02
猜你喜欢
  • 2021-05-21
  • 2021-08-02
  • 2022-01-21
  • 2022-12-23
  • 2022-12-23
  • 2021-07-28
相关资源
相似解决方案