{"id":4998,"date":"2020-05-13T09:54:44","date_gmt":"2020-05-13T01:54:44","guid":{"rendered":"https:\/\/www.xttblog.com\/?p=4998"},"modified":"2020-05-13T09:54:44","modified_gmt":"2020-05-13T01:54:44","slug":"sh-cross-env-command-not-found-%e9%97%ae%e9%a2%98%e4%bf%ae%e5%a4%8d","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=4998","title":{"rendered":"sh: cross-env: command not found \u95ee\u9898\u4fee\u590d"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u6700\u8fd1\u7684\u8dd1\u4e00\u4e2a nodejs \u9879\u76ee\u65f6\u9047\u5230\u4e86\u95ee\u9898\uff0c\u5f88\u591a\u524d\u7aef\u90fd\u4e0d\u77e5\u9053\u5982\u4f55\u4e0b\u624b\u89e3\u51b3\uff01<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6211\u8fd9\u4e2a\u540e\u7aef\u8001\u53f8\u673a\uff0c\u65e0\u5948\u4e4b\u4e0b\uff0c\u4e00\u987f\u767e\u5ea6\u8c37\u6b4c\uff0c\u6700\u7ec8\u627e\u5230\u89e3\u51b3\u65b9\u6848\u3002\u524d\u7aef\u4e5f\u5e76\u4e0d\u662f\u4e0d\u53ef\u8de8\u8d8a\u7684\u3002\u3002\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u9519\u8bef\u4ea7\u751f\u7684\u539f\u56e0\u662f\uff0c\u9879\u76ee\u4e2d\u914d\u7f6e\u4e86 cross-env APP_TYPE=site PORT=8888 umi dev\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"name\": \"\u4e1a\u4f59\u8349\",\n  \"version\": \"2.5.2\",\n  \"description\": \"An out-of-box UI solution for enterprise applications\",\n  \"private\": true,\n  \"scripts\": {\n    \"presite\": \"cd functions &amp;&amp; npm install\",\n    \"start\": \"cross-env APP_TYPE=site PORT=8888 umi dev\"\n    \/\/ ....\n  }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u7136\u540e\u5728\u8fd0\u884c npm run dev \u65f6\u62a5\u9519\u4e86\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&gt; Code@1.0.0 dev \/User\/xtt\/Code\n&gt; cross-env APP_TYPE=site PORT=8888 umi dev\n\nsh: 1: cross-env: not found\n\nnpm ERR! Linux 4.4.0-51-generic\nnpm ERR! argv \"\/usr\/local\/bin\/node\" \"\/usr\/local\/bin\/npm\" \"run\" \"dev\"\nnpm ERR! node v7.8.0\nnpm ERR! npm  v4.2.0\nnpm ERR! file sh\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno ENOENT\nnpm ERR! syscall spawn\nnpm ERR! Code@1.0.0 dev: `cross-env APP_TYPE=site PORT=8888 umi dev`\nnpm ERR! spawn ENOENT\nnpm ERR!\nnpm ERR! Failed at the Code@1.0.0 dev script 'cross-env APP_TYPE=site PORT=8888 umi dev'.\nnpm ERR! Make sure you have the latest version of node.js and npm installed.\nnpm ERR! If you do, this is most likely a problem with the Code package,\nnpm ERR! not with npm itself.\nnpm ERR! Tell the author that this fails on your system:\nnpm ERR!     cross-env APP_TYPE=site PORT=8888 umi dev\nnpm ERR! You can get information on how to open an issue for this project with:\nnpm ERR!     npm bugs Code\nnpm ERR! Or if that isn't available, you can get their info via:\nnpm ERR!     npm owner ls Code\nnpm ERR! There is likely additional logging output above.\n\nnpm ERR! Please include the following file with any support request:\nnpm ERR!     \/User\/xtt\/.npm\/_logs\/2020-04-28T17_24_11_458Z-debug.log<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u89e3\u51b3\u529e\u6cd5\u5f88\u7b80\u5355\uff0c\u5b89\u88c5\u4e00\u4e0b cross-env \u5373\u53ef\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install cross-env --save-dev<\/code><\/pre>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=4998\">sh: cross-env: command not found \u95ee\u9898\u4fee\u590d<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u7684\u8dd1\u4e00\u4e2a nodejs \u9879\u76ee\u65f6\u9047\u5230\u4e86\u95ee\u9898\uff0c\u5f88\u591a\u524d\u7aef\u90fd\u4e0d\u77e5\u9053\u5982\u4f55\u4e0b\u624b\u89e3\u51b3\uff01 \u6211\u8fd9\u4e2a\u540e\u7aef\u8001\u53f8\u673a\uff0c\u65e0\u5948\u4e4b\u4e0b\uff0c\u4e00\u987f [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[1514,1555,1433,1434,648],"class_list":["post-4998","post","type-post","status-publish","format-standard","hentry","category-html5","tag-cnpm","tag-nodejs","tag-npm","tag-vue"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/4998","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4998"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/4998\/revisions"}],"predecessor-version":[{"id":4999,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/4998\/revisions\/4999"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4998"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4998"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4998"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}