【发布时间】:2019-01-25 21:58:01
【问题描述】:
我在运行时遇到问题:sails run rebuild-cloud-sdk
我收到以下错误:Could not regenerate the configuration for the "Cloud SDK" -- the JavaScript module used for AJAX and WebSockets. TypeError: Cannot read property 'write' of undefined
这是导致脚本文件中错误的行:
await sails.helpers.fs.write.with({
任何可能有问题的想法都试图用谷歌搜索解决方案,但找不到任何东西。我怀疑它可能与配置有关,因为我从一个空的 Sails 应用程序开始。
编辑:
从脚本文件调用失败的函数,您可以在 Sails.js 种子应用程序 (LINE 115) 中找到该文件:https://github.com/balderdashy/seed/blob/master/scripts/rebuild-cloud-sdk.js
【问题讨论】:
-
这段代码放在哪里?什么文件?
-
@Noitidart 刚刚编辑了问题
-
开始将第 115 行的代码修改为
console.log的内容以进行调查。这肯定会帮助您修复它。 -
@Noitidart 看起来我试图 console.logsails.helpers 看看它是否会返回 .fs 方法,但它没有。不知道是什么原因