2017-07-19 47 views
0

爲什麼我無法使用webpack運行我的Vue腳本。我得到這個錯誤。無法運行Vuejs依賴關係未找到

ERROR Failed to compile with 11 errors        19.32.28 

These dependencies were not found: 

* @/components/naven in ./src/main.js 
* @/components/navtab in ./src/main.js 
* @/components/artikel in ./src/main.js 
* @/components/navbtm in ./src/main.js 
* @/components/hero in ./src/main.js 
* @/components/btmdata in ./src/main.js 
* @/components/navbtn in ./src/main.js 
* @/components/foot in ./src/main.js 
* @/components/social in ./src/main.js 
* @/components/contenthome in ./src/main.js 
* @/components/Content-home in ./src/router/index.js 

To install them, you can run: npm install --save @/components/naven 
@/components/navtab @/components/artikel @/components/navbtm 
@/components/hero @/components/btmdata @/components/navbtn 
@/components/foot @/components/social @/components/contenthome 
@/components/Content-home 
> Listening at http://localhost:8080 
[email protected]:~/server/vue-test$ 

我得到這樣的結果在我的瀏覽

Cannot GET/
+0

請提供更多信息。解釋你到目前爲止做了什麼。你是否先用'npm install'安裝了依賴項? – ironcladgeek

+0

我在我的窗口中創建了這個項目。當我上傳這個項目來承載我得到的許多錯誤。我使用'npm install'來刪除錯誤,但不起作用。我手動安裝我所有的npm庫。但是當所有的庫完成安裝。我無法在我的項目中導入所有組件。 – Ppabcd

+0

看來你沒有在你的服務器上安裝'node'和'npm'!順便說一下,你不能手動安裝npm庫,因爲它們中的大多數都有很多依賴,應該用'npm'解決。如果您的項目在本地運行良好,那麼問題出在服務器端。 – ironcladgeek

回答

0

我想你應該更新「VUE」版本,最新的版本。

或試試這個

import ComponentName from 'components/ComponentPage' 

你必須添加@/,當你使用最新版本(vue: ^2.4.2

,但我猜你的錯誤日誌中的意思是「你的代碼是最新的版本,但是,你的vue是舊版本「。

相關問題