2017-07-19 49 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是旧版本“。

相关问题