报错如下:复制代码
C:\Users\38201\AppData\Roaming\npm\node_modules\cordova-hot-code-push-cli\node_modules\winattr\lib\whichLib.js:87
throw error;
^
Error: �ļ�δ�ҵ�
at get_parseResult (C:\Users\38201\AppData\Roaming\npm\node_modules\cordova-hot-code-push-cli\node_modules\winattr\lib\shell\index.js:44:12)
at Object.getSync (C:\Users\38201\AppData\Roaming\npm\node_modules\cordova-hot-code-push-cli\node_modules\winattr\lib\shell\index.js:148:11)
at C:\Users\38201\AppData\Roaming\npm\node_modules\cordova-hot-code-push-cli\node_modules\winattr\lib\index.js:27:30
at Object.run (C:\Users\38201\AppData\Roaming\npm\node_modules\cordova-hot-code-push-cli\node_modules\winattr\lib\whichLib.js:74:12)
at Object.getSync (C:\Users\38201\AppData\Roaming\npm\node_modules\cordova-hot-code-push-cli\node_modules\winattr\lib\index.js:25:19)
at statSync (C:\Users\38201\AppData\Roaming\npm\node_modules\cordova-hot-code-push-cli\node_modules\hidefile\index.js:131:28)
at Object.isHiddenSync (C:\Users\38201\AppData\Roaming\npm\node_modules\cordova-hot-code-push-cli\node_modules\hidefile\index.js:227:13)
at Object.fileChangeFilter [as filter] (C:\Users\38201\AppData\Roaming\npm\node_modules\cordova-hot-code-push-cli\dist\server.js:89:20)
at C:\Users\38201\AppData\Roaming\npm\node_modules\cordova-hot-code-push-cli\node_modules\watch\main.js:53:44
at FSReqWrap.oncomplete (fs.js:159:5)复制代码
网上碰到这个问题的很少 而 cordova-hot-code-push-cli 这插件也好几年没更了
所以 经过一番摸索发现 导致这个问题 是因为本地node版本过高导致 报这错的时候我的node版本是10.5.0 ,然后我把自己node降到8.12.0,就好了,我问过一同事 10.4.0 也没报错。。。
PS C:\Users\38201\Desktop> node -v
v8.12.0
PS C:\Users\38201\Desktop> npm -v
6.4.0
复制代码
贴个图片方便小伙伴们对比 红线上面失败 降级node 之后成功