npm安装依赖后报错

今天npm安装依赖后报错

复制代码
 error  in ./node_modules/shpjs/lib/index.js

Module parse failed: Unexpected token (129:39)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

是因为无法识别 ?. 语法,导致报错Module parse failed: Unexpected token

解决:

在vue.config.js 里面加上 transpileDependencies: ['ol', "color-parse", 'ol/renderer/webgl', 'shpjs'],

哪个包报错就加上哪个包

相关推荐
niucloud-admin1 天前
web 端前端
前端
胖者是谁1 天前
EasyPlayerPro的使用方法
前端·javascript·css
EndingCoder1 天前
索引类型和 keyof 操作符
linux·运维·前端·javascript·ubuntu·typescript
liux35281 天前
Web集群管理实战指南:从架构到运维
运维·前端·架构
沛沛老爹1 天前
Web转AI架构篇 Agent Skills vs MCP:工具箱与标准接口的本质区别
java·开发语言·前端·人工智能·架构·企业开发
小光学长1 天前
基于Web的长江游轮公共服务系统j225o57w(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面。
前端·数据库
Joe5561 天前
vue2 + antDesign 下拉框限制只能选择2个
服务器·前端·javascript
ChangYan.1 天前
monorepo 多包管理识别不到新增模块,解决办法
前端·chrome
Jinuss1 天前
React元素创建介绍
前端·react.js
济6171 天前
linux 系统移植(第六期)--Uboot移植(5)--bootcmd 和 bootargs 环境变量-- Ubuntu20.04
java·前端·javascript