vue 项目有时候安装完依赖以后,启动项目时无法启动,报下面错误,
Error: No valid exports main found for 'E:\project\SmartCityMgr\smart-community\smart-community-ui\node_modules\
domhandler\node_modules\domelementtype'
1、遇到以上问题主要是node版本原因,通过命令行 where node,查询到node安装目录,
通过https://nodejs.org/zh-cn/download/
查看node对应版本,安装推荐版本。
2、可能是依赖引入方式,可以使用npm install 或者淘宝镜像npm install --registry=https://registry.npmmirror.com,据说,cnpm 有时候有bug。
3、删掉依赖,重新安装启动。