我目前正在测试MERN Stack作为LAMP Stack的替代品,因为市场显然正在转变。不幸的是,我遇到了最着名的编程动机杀手;设置失败:
在我使用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
答案 0 :(得分:1)
将节点升级到较新版本。节点6中不支持此功能。要获得完全支持,您可能希望至少使用8.x +