作者:包子F3R | 来源:互联网 | 2023-07-06 14:30
webstorm中运行uniapp:npmrundev:h5错误信息如下:D:\uniapp-Project\cga-miniapp-208\4-Invoicenpmrundev
webstorm中运行uniapp:npm run dev:h5
错误信息如下:
D:\uniapp-Project\cga-miniapp-208-Invoice>npm run dev:h5
> 4-Invoice@0.1.0 dev:h5 D:\uniapp-Project\cga-miniapp-208-Invoice
> cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-service uni-serve
D:\uniapp-Project\cga-miniapp-208-Invoice\node_modules\@dcloudio\uni-cli-shared\lib\util.js
:7
const normalizePath = path => (isWin ? path.replace(/\\/g, '/') : path)
^
TypeError: Cannot read property 'replace' of undefined
at normalizePath (D:\uniapp-Project\cga-miniapp-208-Invoice\node_modules\@dcloudio\uni-
cli-shared\lib\util.js:7:45)
.........
npm ERR! code ELIFECYCLE
npm ERR! errno 7
npm ERR! 4-Invoice@0.1.0 dev:h5: `cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-serv
ice uni-serve`
npm ERR! Exit status 7
npm ERR! npm ERR!
npm ERR! Failed at the 4-Invoice@0.1.0 dev:hnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\admin\AppData\Roaming\npm-cache\_logs21-10-29T03_00_03_526Z-debug.log
解决方法:把错误所在的包重新下载即可
如上述错误所在位置为:node_modules\@dcloudio\uni- cli-shared\lib\util.js:7:45
本文来自博客园,作者:1940,转载请注明原文链接:https://www.cnblogs.com/beiyi-Lin/p/15479481.html
原文链接:https://www.cnblogs.com/beiyi-Lin/p/15479481.html