npm:6.10
nodejs:8.11.3
我按照文档https://dvajs.com/guide/getting-started.html#%E5%88%9B%E5%BB%BA%E6%96%B0%E5%BA%94%E7%94%A8 ,运行到npm install antd babel-plugin-import --save 时弹出错误,这个是什么原因?
npm install antd babel-plugin-import --save
Unhandled rejection RangeError: Maximum call stack size exceededill install loadIdealTree
at RegExp.test (
at /usr/local/lib/node_modules/npm/node_modules/aproba/index.js:38:16
at Array.forEach (
at module.exports (/usr/local/lib/node_modules/npm/node_modules/aproba/index.js:33:11)
at flatNameFromTree (/usr/local/lib/node_modules/npm/lib/install/flatten-tree.js:37:3)
at flatNameFromTree (/usr/local/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
at flatNameFromTree (/usr/local/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
at flatNameFromTree (/usr/local/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
at flatNameFromTree (/usr/local/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
at flatNameFromTree (/usr/local/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
at flatNameFromTree (/usr/local/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
at flatNameFromTree (/usr/local/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
at flatNameFromTree (/usr/local/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
at flatNameFromTree (/usr/local/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
at flatNameFromTree (/usr/local/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
at flatNameFromTree (/usr/local/lib/node_modules/npm/lib/install/flatten-tree.js:39:14)
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! https://github.com/npm/npm/issues
npm ERR! A complete log of this run can be found in:
npm ERR! /home/bao/.npm/_logs/2018-06-15T09_34_54_179Z-debug.log
这是 npm 的问题,试试 cnpm 或者 yarn .
出现同样的问题,上一秒还是好的,下一秒就什么都不行了
“快速上手”遇到同样的问题,
rm -rf node_modules
yarn
yarn add antd
yarn add babel-plugin-import
就好了。
虽说是npm的问题,但总觉得还是某个配置触发了npm的bug。
删除node_modules试试
删除node_modules试试
好了,多谢,能说下为什么吗?
可能node与npm的版本不兼容,可以尝试给npm降版本
删除node_modiles可以 管用
Most helpful comment
删除node_modules试试