我目前正在测试 MERN 堆栈作为 LAMP 堆栈的替代方案,因为市场显然正在发生变化。不幸的是,我遇到了编程中最大的动力杀手。设置失败:
npm install
在我之前创建的目录中运行mern init initial_app
时,我不断收到相同的错误:TypeError: Object.entries is not a function
.
以下是相关日志文件中的错误:
694 verbose stack TypeError: Object.entries is not a function
694 verbose stack at Object.report [as install] (C:\Users\User\AppData\Roaming\npm\node_modules\npm\node_modules\npm-audit-report\reporters\install.js:27:31)
694 verbose stack at Promise (C:\Users\User\AppData\Roaming\npm\node_modules\npm\node_modules\npm-audit-report\index.js:18:46)
694 verbose stack at report (C:\Users\User\AppData\Roaming\npm\node_modules\npm\node_modules\npm-audit-report\index.js:17:10)
694 verbose stack at Object.printInstallReport (C:\Users\User\AppData\Roaming\npm\node_modules\npm\lib\install\audit.js:87:10)
694 verbose stack at Object.Installer.printInstalledForHuman (C:\Users\User\AppData\Roaming\npm\node_modules\npm\lib\install.js:847:31)
694 verbose stack at Bluebird.try.then (C:\Users\User\AppData\Roaming\npm\node_modules\npm\lib\install.js:774:19)
694 verbose stack at tryCatcher (C:\Users\User\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
694 verbose stack at Promise._settlePromiseFromHandler (C:\Users\User\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:512:31)
694 verbose stack at Promise._settlePromise (C:\Users\User\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:569:18)
694 verbose stack at Promise._settlePromise0 (C:\Users\User\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:614:10)
694 verbose stack at Promise._settlePromises (C:\Users\User\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:693:18)
694 verbose stack at Async._drainQueue (C:\Users\User\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:133:16)
694 verbose stack at Async._drainQueues (C:\Users\User\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:143:10)
694 verbose stack at Immediate.Async.drainQueues (C:\Users\User\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:17:14)
694 verbose stack at runCallback (timers.js:672:20)
694 verbose stack at tryOnImmediate (timers.js:645:5)
695 verbose cwd D:\MERN\initial_app
696 verbose Windows_NT 10.0.16299
697 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
698 verbose node v6.11.1
699 verbose npm v6.0.0
700 error Object.entries is not a function
701 verbose exit [ 1, true ]
您知道是什么导致了这里的错误,或者您是否遇到过有关 mern-cli 的类似情况?如果这是与 mern-cli 直接相关的某种问题,我不介意,将其重新发布到相应的 Github 页面。
提前谢谢你,J0nny