我正在开发一个流行的 wordpress 插件(Sensei-lms)的分支......插件开发人员已在此页面上提供了创建开发环境的说明:https ://github.com/Automattic/sensei/wiki/Setting-Up -您的开发环境#configure-a-local-wordpress-instance
我已经按照说明创建了一个干净的实例并克隆了 git repo
但是在运行npm install
命令时,我总是收到以下错误:
vagrant@vvv:/srv/www/wordpress-one/public_html/wp-content/plugins/sensei$ npm install
npm ERR! Maximum call stack size exceeded
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vagrant/.npm/_logs/2021-09-07T03_45_45_825Z-debug.log
除了重复问题之外,日志文件并没有真正给出任何问题的迹象......
19886 verbose stack RangeError: Maximum call stack size exceeded
19886 verbose stack at RegExp.test (<anonymous>)
19886 verbose stack at isDepOptional (/usr/lib/node_modules/npm/lib/install/deps.js:432:45)
19886 verbose stack at failedDependency (/usr/lib/node_modules/npm/lib/install/deps.js:441:9)
19886 verbose stack at failedDependency (/usr/lib/node_modules/npm/lib/install/deps.js:457:9)
19886 verbose stack at failedDependency (/usr/lib/node_modules/npm/lib/install/deps.js:457:9)
19886 verbose stack at failedDependency (/usr/lib/node_modules/npm/lib/install/deps.js:457:9)
19886 verbose stack at failedDependency (/usr/lib/node_modules/npm/lib/install/deps.js:457:9)
19886 verbose stack at failedDependency (/usr/lib/node_modules/npm/lib/install/deps.js:457:9)
19886 verbose stack at failedDependency (/usr/lib/node_modules/npm/lib/install/deps.js:457:9)
19886 verbose stack at failedDependency (/usr/lib/node_modules/npm/lib/install/deps.js:457:9)
19886 verbose stack at failedDependency (/usr/lib/node_modules/npm/lib/install/deps.js:457:9)
19886 verbose stack at failedDependency (/usr/lib/node_modules/npm/lib/install/deps.js:457:9)
19886 verbose stack at failedDependency (/usr/lib/node_modules/npm/lib/install/deps.js:457:9)
19886 verbose stack at failedDependency (/usr/lib/node_modules/npm/lib/install/deps.js:457:9)
19886 verbose stack at failedDependency (/usr/lib/node_modules/npm/lib/install/deps.js:457:9)
19886 verbose stack at failedDependency (/usr/lib/node_modules/npm/lib/install/deps.js:457:9)
19887 verbose cwd /srv/www/sensei/public_html/wp-content/plugins/sensei-lms
19888 verbose Linux 5.4.0-80-generic
19889 verbose argv "/usr/bin/node" "/usr/bin/npm" "install"
19890 verbose node v14.17.6
19891 verbose npm v6.14.15
19892 error Maximum call stack size exceeded
19893 verbose exit [ 1, true ]
从我的阅读来看,安装的依赖项的迭代似乎已经达到了极限。
我没有运气尝试了以下所有方法:
1:根据多个博客和文章建议这样做
vagrant@vvv:...$ cd /srv/www/wordpress-one/public_html/wp-content/plugins/sensei vagrant@vvv:...$ rm -fr /usr/lib/node_modules vagrant@vvv:...$ rm -fr node_modules/ vagrant@vvv:...$ npm cache clean --force vagrant@vvv:...$ npm rebuild vagrant@vvv:...$ rm package-lock.json vagrant@vvv:...$ npm install
2:根据http://pyha.ru/forum/topic/9396.1
vagrant@vvv:...$ cd /srv/www/wordpress-one/public_html/wp-content/plugins/sensei vagrant@vvv:...$ rm -fr /usr/lib/node_modules vagrant@vvv:...$ rm -fr node_modules/ vagrant@vvv:...$ npm cache clean --force vagrant@vvv:...$ node --stack-size=10000 /usr/lib/node_modules/npm/bin/npm-cli.js install
任何进一步的帮助 - 我可能做错了什么?
除了上述问题:
我在 Macbook Pro 上运行 VVV,默认设置会创建一个 VVV 机器,该机器运行带有 npm 6.14.15 版本的 Ubuntu 20.04.3 LTS 便当盒(来自 nodejs 包版本:14.17.6-deb-1nodesource1)
我已经销毁了 VVV 实例并再次从干净的环境中开始工作,而没有我在之前的尝试中可能会产生的任何问题 - 仍然失败!
我已经去了我的桌面 linux 机器(与运行 VVV 的 mac 不同的机器) - linux 桌面本机运行 Ubuntu 20.04.3 LTS,默认安装 npm 6.14.4 版本(来自 nodejs 包版本:10.19.0~ dfsg-3ubuntu1) 和干净的老师
git clone
,npm install
工作正常!