我有角度 CLI 7.3.0。根据这里的发布描述,本次发布还涉及发布@angular-devkit/build-angular 0.13.0。
正如你在下面的屏幕截图中看到的,我有 @angular-devkit/build-angular、@angular-devkit/architect、@angular-devkit/build-optimizer、@angular-devkit/build-webpack 版本均为 0.10.2 。
然后我执行了 操作ng update,CLI 告诉我一切正常。为什么?难道它不应该告诉我需要将前面提到的所有软件包更新到 0.13.0 吗?
或者更好的是,当我执行操作时,这些软件包不应该自动更新吗ng update @angular/cli?这是我更新到 CLI 7.3.0 时执行的命令,但 @angular-devkit 软件包没有更新

我想通过 Flutter 调用 Cloud Functions 获取数据。
这是我的代码。
const functions = require("firebase-functions");
const admin = require('firebase-admin');
const fetch = require('node-fetch');
admin.initializeApp();
exports.postalCode = functions.https.onCall( (data, context) => {
const URL = 'https://zipcloud.ibsnet.co.jp/api/search?zipcode=100-0002';
return fetch(URL).then(res => res.json());
});
Run Code Online (Sandbox Code Playgroud)
错误 [ERR_REQUIRE_ESM]:必须使用 import 加载 ES 模块:/Users/xxx/node_modules/node-fetch/src/index.js
不支持 ES 模块的 require()。/Users/xxx/xxx/functions/index.js 中的 /Users/xxx/node_modules/node-fetch/src/index.js 的 require() 是一个 ES 模块文件,因为它是一个距离父包最近的 .js 文件。 package.json 包含 "type": "module" ,它将该包范围内的所有 .js 文件定义为 ES 模块。
相反,将 /Users/xxx/node_modules/node-fetch/src/index.js 重命名为以 .cjs 结尾,更改所需代码以使用 import(),或从 /Users/xxx/node_modules 中删除 "type": "module" /node-fetch/package.json。
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1102:13)
at …Run Code Online (Sandbox Code Playgroud) 所以我已经部署了我的网站 Nodejs + MySQL,但问题是我收到错误
503 Service Unavailable The server is temporarily busy, try again later!
所以我看到了一个线程:相反,将index.js的需求更改为所有CommonJS模块中都可用的动态导入(),我按照该线程并安装了
npm i node-fetch@2.6.1
之后,我也返回到我的setup nodejs并停止该过程,然后npm install再次收到相同的错误,当我检查我的时,stderr.log我收到此错误
/usr/local/lsws/fcgi-bin/lsnode.js:48 var app = require(startupFile); ^
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/ppsconl2/nodejs/index.js from /usr/local/lsws/fcgi-bin/lsnode.js not supported.
Instead change the require of index.js in /usr/local/lsws/fcgi-bin/lsnode.js to a dynamic import() which is available in all CommonJS modules.
at startApplication (/usr/local/lsws/fcgi-bin/lsnode.js:48:15)
at Object.<anonymous> (/usr/local/lsws/fcgi-bin/lsnode.js:16:1) {
code: 'ERR_REQUIRE_ESM'
}
Run Code Online (Sandbox Code Playgroud)
这是我的 package.json
{
"name": …Run Code Online (Sandbox Code Playgroud) 我是Google Cloud Functions功能和实现的新手。因此,我想知道是否可以使用Cloud函数向第三方服务器API发出HTTP或HTTPS请求,如果可以,怎么办?当我收到响应数据时,可以使用相同的云函数实例将其存储到Firebase数据库中吗?
以及如何使该请求被定期调用或安排?提前致谢
httprequest node.js firebase google-cloud-platform google-cloud-functions
node.js ×3
angular ×1
angular-cli ×1
deployment ×1
firebase ×1
flutter ×1
httprequest ×1
javascript ×1
node-fetch ×1