gpt4 book ai didi

NPM:找不到模块 'uuid'

转载 作者:行者123 更新时间:2023-12-04 12:39:41 32 4
gpt4 key购买 nike

当我尝试使用 npm 时,我收到此消息:

> $ npm
module.js:472
throw err;
^

Error: Cannot found module 'uuid'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.ks:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/metrics.js:10:12)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
我尝试使用 brew 卸载重新安装,但没有成功。

最佳答案

你可以试试(ECMAScript Module 语法)

import { v1 as uuidv1 } from 'uuid';
console.log(uuidv1()); //=> f68f7b70-9606-11ea-9ccc-fbd3ee221c8f

使用 v4
import { v4 as uuidv4 } from 'uuid';
uuidv4(); // ⇨ '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d'

更多信息: https://www.npmjs.com/package/uuid

关于NPM:找不到模块 'uuid',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43865189/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com