简体   繁体   English

uniqid 已安装,但我无法使用其功能

[英]uniqid was installed but I can't use its function

I installed uniqid from npm but when I use uniqid(), it return an error TypeError: _uniqid.uniqid is not a function我从 npm 安装了 uniqid,但是当我使用 uniqid() 时,它返回一个错误 TypeError: _uniqid.uniqid is not a function

import { uniqid } from 'uniqid';


console.log(uniqid()) ;

使用import uniqid from 'uniqid';更改您的第一行import uniqid from 'uniqid';

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么我不能在try块中定义之前使用Javascript函数? - Why can't I use a Javascript function before its definition inside a try block? 我无法在Javascript中使用我的函数 - I can't use my function in Javascript 我已经使用 npm 全局安装了夏普,但我不能使用它 - I have installed Sharp globally using npm but I can't use it 我安装了 Node.js 但我不能在 windows 上使用 npm - I installed Node.js but I can't use npm on windows 我正在使用jQuery .scroll()函数,为什么不能用另一个函数覆盖它的效果? - I'm using the jQuery .scroll() function, why can't I override its effects with another function? 我无法在带有已安装的phonegap插件的Eclipse中使用CSS,JavaScript文件 - I can't use css, javascript file in eclipse with installed phonegap plugin 我可以使用父函数的参数来命名其子函数吗? - Can I use a parent function's parameter to name its child function? 如果我无法访问其输出,为什么我可以扩展箭头功能? - Why can I extend an arrow function if I can't access its output? 为什么我不能通过传递它的变量名来运行这个回调,但我可以将它包装在一个函数中? - Why can't I run this callback by just passing its variable name, but I can wrap it in a function? 模态无法访问其显示功能 - modal can't access its show function
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM