1. 程式人生 > >ERROR in [copy-webpack-plugin] unable to locate "D:/xxx/xxx/xxx"

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

mage pac com error 技術 sheet body image 分享圖片

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:\trainh5vue\Content‘ at ‘D:\trainh5vue\Content‘

找了找發現有兩樣式文件一直沒有打包進去,而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 就好了

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