npm run dev报错

前一天配置一个文件的环境,尝试了好多下载方法,包括yarn cnpm npm

第二天 npm run dev直接报错

npm ERR! Maximum call stack size exceeded 

百度之后说给npm降级或者升级

  • 降级 : npm install -g npm@5.4.0
  • 升级 : npm install -g npm  升级到最新版

结果降级之后再尝试的时候就直接报版本跟node.js不兼容的问题,然后各种在升级都不好使,只能重新删掉在升级。

You are likely using a version of node-tar or npm that is incompatible with this version of Node.js.
Please use either the version of npm that is bundled with Node.js, or a version of npm (> 5.5.1 or < 5.4.0) or node-tar (> 4.0.1) that is compa
tible with Node.js 9 and above.

解决办法: 

  1、npm uninstall -g npm

  2、npm install -g npm

posted @ 2020-01-03 12:01  Rachid  阅读(221)  评论(0编辑  收藏  举报