问题发生
│ Update available 5.3.0 → 7.20.2 │
│ Run npm i -g npm to update │
在听信了这个建议之后,我执行了升级的命令,然鹅就出现了下面的问题。
$ npm -v
TypeError [ERR_INVALID_ARG_TYPE]: The “original” argument must be of type function
at promisify (internal/util.js:206:11)
at Object. (/usr/local/lib/node_modules/npm/node_modules/@npmcli/move-file/index.js:26:18)
at Module._compile (module.js:573:30)
at Object.Module._extensions…js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
at Module.require (module.js:517:17)
at require (internal/module.js:11:18)
at Object. (/usr/local/lib/node_modules/npm/node_modules/cacache/lib/entry-index.js:16:18)
解决问题
网上一大堆的都是nrm报这个错,或者是path报错的,就是没有我这种升级导致的问题。本着活人不能让尿憋死和死马当活马医的原则,我没有卸载mac上的nodejs配置,木有任何多余的操作,转身就直接在nodejs官网上下载了pkg文件,点击安装。安装之后,然后再node -v,npm-v ,成功滴解决了问题。
不要怕,就是干,大不了重装系统!