@types/crypto-js를 사용할 때Generate가 불가능한 문제를 수정합니다
7249 단어 Nuxt.jsTypeScriptTipsWebtech
yarn add @types/crypto-js
면yarn generate
화학반응이 발생한다.$ yarn generate
...
ERROR in <path-to-project>/node_modules/secure-ls/dist/secure-ls.d.ts
ERROR in <path-to-project>/node_modules/secure-ls/dist/secure-ls.d.ts(4,9):
4:9 Module '"<path-to-project>/node_modules/@types/crypto-js"' has no exported member 'CipherHelper'.
2 |
3 | import * as LZString from 'lz-string';
> 4 | import {CipherHelper, Encoder} from 'crypto-js';
| ^
5 |
6 | declare class SecureLS {
7 | constructor(config?: { isCompression?: boolean, encodingType?: string, encryptionSecret?: string , encryptionNamespace?: string });
ERROR in <path-to-project>/node_modules/secure-ls/dist/secure-ls.d.ts
ERROR in <path-to-project>/node_modules/secure-ls/dist/secure-ls.d.ts(4,23):
4:23 Module '"<path-to-project>/node_modules/@types/crypto-js"' has no exported member 'Encoder'.
2 |
3 | import * as LZString from 'lz-string';
> 4 | import {CipherHelper, Encoder} from 'crypto-js';
| ^
5 |
6 | declare class SecureLS {
7 | constructor(config?: { isCompression?: boolean, encodingType?: string, encryptionSecret?: string , encryptionNamespace?: string });
FATAL Nuxt build error 19:29:50
at WebpackBundler.webpackCompile (node_modules/@nuxt/webpack/dist/webpack.js:5497:21)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async WebpackBundler.build (node_modules/@nuxt/webpack/dist/webpack.js:5446:5)
at async Builder.build (node_modules/@nuxt/builder/dist/builder.js:5634:5)
at async Generator.initiate (node_modules/@nuxt/generator/dist/generator.js:171:7)
at async Generator.generate (node_modules/@nuxt/generator/dist/generator.js:133:5)
at async Object.run (node_modules/@nuxt/cli/dist/cli-generate.js:376:24)
at async NuxtCommand.run (node_modules/@nuxt/cli/dist/cli-index.js:2803:7)
╭─────────────────────────────╮
│ │
│ ✖ Nuxt Fatal Error │
│ │
│ Error: Nuxt build error │
│ │
╰─────────────────────────────╯
error Command failed with exit code 1.
수정 방법
@types/crypto-js
의 버전은 ^3.1.47
입니다.{
...
"dependencies": {
...
"@types/crypto-js": "^4.0.1", <- ココ
}
}
인용하다
Reference
이 문제에 관하여(@types/crypto-js를 사용할 때Generate가 불가능한 문제를 수정합니다), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://zenn.dev/mizuki/articles/958a883c7d605a텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)