[英]Unexpected token “<” when importing from third party library into React project
[英]Third party Vue Component throwing unexpected token error when importing
试图通过使用laravel-elixir-vueify的NPM包含称为vue-product-carousel的第三方vue组件。
package.json包含:
"laravel-elixir": "^5.0.0",
"laravel-elixir-vueify": "^1.0.6",
"vue": "^1.0.26",
"vue-product-carousel": "^0.1.3"
节点和NPM:
NPM 3.8.6
NODE 5.12.0
我写的组件都很好,效果很好。 当我尝试添加vue-product-carosuel时,抛出此错误:
/home/vagrant/Code/core-ds/node_modules/vue-product-carousel/src/carousel.vue:1
<template>
^
ParseError: Unexpected token
组件是必需的,如下所示:
carousel: require('vue-product-carousel')
和元素:
<carousel :images="media"></carousel> //media is an array of images
我的构建可能会丢失一些东西吗?
可能存在一些配置,其中排除了node_modules
内部要由vueify
解析的vueify
。
在这种情况下, require
将“ carousel.vue”视为一个JavaScript文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.