我试着用纳米体(https://www.npmjs.com/package/nanoid/v/2.1.2)
exports = async function(){
const nanoid = require("nanoid");
const uid = nanoid(10);
}来自MongoDB领域运行时,但它抛出:
uncaught promise rejection: failed to eval source for module 'nanoid': node_modules/nanoid/index.cjs: Line 9:7 Unexpected identifier (and 16 more errors)这就是我从领域仪表板上看到的所有错误。
什么东西可能少了?
发布于 2021-02-16 20:41:47
对我有效的解决方案:
npm i nanoid@2.1.2然后通过仪表板将包上传到MongoDB领域函数。
https://stackoverflow.com/questions/66225336
复制相似问题