{"id":186660,"date":"2020-10-18T22:26:26","date_gmt":"2020-10-18T14:26:26","guid":{"rendered":"http:\/\/4563.org\/?p=186660"},"modified":"2020-10-18T22:26:26","modified_gmt":"2020-10-18T14:26:26","slug":"vue-ts-%e4%b8%ad-import-crypto-from-crypto-%e5%a4%b1%e8%b4%a5%ef%bc%8c%e6%8f%90%e7%a4%ba-cannot-find-module-crypto-or-its-corresponding-type-declarations","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=186660","title":{"rendered":"vue + ts \u4e2d import crypto from &#8216;crypto&#8217; \u5931\u8d25\uff0c\u63d0\u793a Cannot find module &#8216;crypto&#8217; or its corresponding type declarations."},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  vue + ts \u4e2d import crypto from &#8216;crypto&#8217; \u5931\u8d25\uff0c\u63d0\u793a Cannot find module &#8216;crypto&#8217; or its corresponding type declarations.               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Nicolay <\/span>  <span><i><\/i> 2<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\">                        \u8bf7\u95ee\u5927\u5bb6\u8be5\u600e\u4e48\u529e\u5462\uff0c\u6211\u5728 es6 \u7684\u9879\u76ee\u4e2d\u8fd9\u6837\u5199\u662f\u6ca1\u6709\u95ee\u9898\u7684\uff0c      <\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>5<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4027459\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : Nicolay <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             package.json \u4e2d\u662f\u8fd9\u6837\u5199\u7684 \uff0ccrypto-js \u548c crypto \u90fd\u9700\u8981\u7528\uff0c\u867d\u7136\u6211\u4e0d\u592a\u61c2\u4e8c\u8005\u7684\u533a\u522b\uff0c\u4e0d\u8fc7 import cryptoJs from &#8216;crypto-js&#8217; \u6ca1\u6709\u95ee\u9898\uff0c<br \/>&#8220;dependencies&#8221;: {<br \/> &#8220;@types\/crypto-js&#8221;: &#8220;^3.1.47&#8221;,<br \/> &#8220;@types\/echarts&#8221;: &#8220;^4.8.1&#8221;,<br \/> &#8220;axios&#8221;: &#8220;^0.19.0&#8221;,<br \/> &#8220;crypto&#8221;: &#8220;^1.0.1&#8221;,<br \/> &#8220;crypto-js&#8221;: &#8220;^4.0.0&#8221;,<br \/> },                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4027460\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Timefly <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7f3a\u5c11\u7c7b\u578b\u58f0\u660e\u6587\u4ef6\u5427\uff0c\u6216\u8bb8\u8fd8\u8981\u88c5\u4e00\u4e2a @types\/crypto\uff0c\u5148\u53bb npm \u4e0a\u770b\u770b\u6709\u6ca1\u6709                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4027461\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : Nicolay <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Timefly \u8fd9\u4e2a\u7684\u786e\u6ca1\u6709\uff0c                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4027462\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : mxT52CRuqR6o5 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7528\u5565\u6253\u5305\u7684\uff0ccrypto \u662f node \u81ea\u5e26\u6a21\u5757\uff0c\u6253\u5305\u5668\u4e0d\u5e2e\u4f60\u6253\u5305\u6d4f\u89c8\u5668\u73af\u5883\u662f\u8fd0\u884c\u4e0d\u4e86\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4027463\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : Nicolay <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @mxT52CRuqR6o5 webpack                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>vue + ts \u4e2d import&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/186660"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=186660"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/186660\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=186660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=186660"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=186660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}