cordova 全局安装的时候报错
cnpm i cordova -g
internal/modules/cjs/loader.js:797
throw err;
^
Error: Cannot find module 'fs/promises'
用npm 也一样报
npm i cordova -g
npm ERR! Unexpected end of JSON input while parsing near '...r.com/tmp/-/tmp-0.2.0'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2022-06-06T07_53_00_043Z-debug.log
这时可以先执行下面的命令:
npm cache clean --force
然后再执行 npm i cordova -g就可以了