node.js - 如何在纱线中导入本地依赖项
问题描述
我有2个项目:
- ProjectA:一个 Vue.js 前端项目
- ProjectB:我想在项目 A 中用作库的 js 模块
我正确构建了 ProjectB,然后:yarn link
我在package.json
ProjectA 中添加了依赖项,"ProjectB":"1.0.0"
然后在 ProjectA 根目录中添加yarn link ProjectB
仍然当我尝试导入 ProjectB:
import {Stuff} from 'ProjectB'
Vuejs 项目的构建失败并出现此错误(这似乎无关,但导入导致它):
ERROR Failed to compile with 1 errors
Module build failed (from ./node_modules/@vue/cli-plugin-eslint/node_modules/eslint-loader/index.js):
Error: No ESLint configuration found.
at Config.getLocalConfigHierarchy (/nodejs/wrapper_project/vuejs_frontend/node_modules/eslint/lib/config.js:268:39)
at Config.getConfigHierarchy (/nodejs/wrapper_project/vuejs_frontend/node_modules/eslint/lib/config.js:192:43)
at Config.getConfigVector (/nodejs/wrapper_project/vuejs_frontend/node_modules/eslint/lib/config.js:299:21)
at Config.getConfig (/nodejs/wrapper_project/vuejs_frontend/node_modules/eslint/lib/config.js:342:29)
at processText (/nodejs/wrapper_project/vuejs_frontend/node_modules/eslint/lib/cli-engine.js:181:33)
at CLIEngine.executeOnText (/nodejs/wrapper_project/vuejs_frontend/node_modules/eslint/lib/cli-engine.js:690:40)
at lint (/nodejs/wrapper_project/vuejs_frontend/node_modules/@vue/cli-plugin-eslint/node_modules/eslint-loader/index.js:263:17)
at transform (/nodejs/wrapper_project/vuejs_frontend/node_modules/@vue/cli-plugin-eslint/node_modules/eslint-loader/index.js:237:18)
at /nodejs/wrapper_project/vuejs_frontend/node_modules/loader-fs-cache/index.js:127:18
at ReadFileContext.callback (/nodejs/wrapper_project/vuejs_frontend/node_modules/loader-fs-cache/index.js:31:14)
at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:237:13)
You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.
我错过了什么?
这些问题似乎相关:
解决方案
推荐阅读
- python - 如何在 python 中打印带有转换值的熊猫表?
- r - 使用带有 ShinyApps.io 的私有 GitHub 包
- git - 我怎样才能找到提交的所有变基版本?
- r - R中的Webscraping:循环/自动化如何?
- c# - 如何在 C# 中自动设置 CSV 文件中的标头属性
- jenkins - 如何让 Jenkins 构建等待特定工作完成
- apache - 如何编辑 .htaccess 文件以将 www 重定向到 apache/ubuntu 服务器中的非 www?
- windows - 同一站点托管在 IIS 的多个端口上
- mysql - 通过 findAll 获取数据并在同一请求中从另一个关联实体返回两个计数
- python - 调试,不断重载