Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: randomUUID is not a function #406

Closed
xsunnydong opened this issue Jun 6, 2022 · 5 comments
Closed

TypeError: randomUUID is not a function #406

xsunnydong opened this issue Jun 6, 2022 · 5 comments

Comments

@xsunnydong
Copy link

  • cnpm install
    TypeError: randomUUID is not a function
    at formatInstallOptions (/usr/local/lib/node_modules/cnpm/node_modules/npminstall/lib/format_install_options.js:127:33)
    at module.exports (/usr/local/lib/node_modules/cnpm/node_modules/npminstall/lib/local_install.js:54:13)
    at /usr/local/lib/node_modules/cnpm/node_modules/npminstall/bin/install.js:397:11
    npminstall version: 6.3.0
    cnpm的依赖npminstall 6.3.0 这一版本有问题 cnpm install 时报错 npminstall 退回到6.2.0版本问题解决
    按照官方文档 https://www.npmjs.com/package/randomuuid randomUUID 在v15.6.0引入 !
    Polyfill for the crypto.randomUUID() method as proposed in the WICG randomUUID specification and recently implemented in Node.js v15.6.0.

node 版本 v14.5.0
npm 版本 6.14.5
yarn 版本 1.22.4

@fengmk2
Copy link
Member

fengmk2 commented Jun 6, 2022

请升级到 node 14 的最新版本。

@fengmk2 fengmk2 closed this as completed Jun 6, 2022
@xsunnydong
Copy link
Author

大佬, uuid <=3.4.0在2022年6月3日虽被弃用,但高版本如 v7.x.x v8.x.x版本仍旧可用。不考虑沿用老方法的新版本uuid么?
另外 采用randomUUID 实际中 需版本》= v15.6.0 和npminstall 文档里申明支持 Node.js >= 14.x 不符,造成误解。

@xsunnydong
Copy link
Author

我以为randomUUID和uuid一样是个三方包 从npm官方查看的版本。。。应该是错了
按官方api文档中是说v14.17.0 版本引入 v14.17.0前仍有大量的低版本存在,不兼容一波低版本么?

@fengmk2
Copy link
Member

fengmk2 commented Jun 7, 2022

不兼容,请使用 14 新版。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants