今天在使用taro下载taro-ui插件时报错,报错后吧node-modules删除,然后npm i
后报错
PS F:\WorkFolder\myApp> npm i
npm ERR! Cannot read property 'match' of undefined
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ykuser\AppData\Roaming\npm-cache\_logs\2020-06-19T04_17_40_788Z-debug.log
PS F:\WorkFolder\myApp> npm i
npm ERR! code ENOTFOUND
npm ERR! network request to https://registry.npm.taobao.org/@tarojs%2fcomponents failed, reason: getaddrinfo ENOTFOUND registry.npm.taobao.org
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ykuser\AppData\Roaming\npm-cache\_logs\2020-06-19T04_23_03_786Z-debug.log
PS F:\WorkFolder\myApp> npm cache clear --force
npm WARN using --force I sure hope you know what you are doing.
PS F:\WorkFolder\myApp> npm i
npm ERR! Cannot read property 'match' of undefined
然后解决方法:
首先清楚npm缓存npm cache clear --force
再运行npm i依然报错
后来我运行了
1 rm -rf node_modules
2 rm package-lock.json
3 npm cache clear --force
4 npm install
执行npm i
问题就解决了