ERROR in [copy-webpack-plugin] unable to locate "D:/xxx/xxx/xxx"

vue打包的时候npm run build报错

ERROR in [copy-webpack-plugin] unable to locate "D:/xxx/xxx/xxx"

这表示这个路径出现了错误,找不到正确路径

在你的项目文件夹中找一找有没有这个路径的文件,没有的话,按这个路径把缺失的相应的文件放到里面再重新打包就行了

例如我打包一直报错

ERROR in [copy-webpack-plugin] unable to locate 'D:	rainh5vueContent' at 'D:	rainh5vueContent'

找了找发现有两样式文件一直没有打包进去,而index.html文件里是这样的

<link rel="stylesheet" href="Content/style/static.css">
<link rel="stylesheet" href="Content/style/fontAwesome/css/font-awesome.min.css">

打包生成的文件层级是这样的

 

但这个文件夹的命名不对,所以一直报错,发现存放style的文件夹名不是Content,就把文件夹改成Content,再npm run build 就好了

原文地址:https://www.cnblogs.com/leiting/p/8442214.html