【发布时间】:2018-10-18 19:52:15
【问题描述】:
我在一个单一的 git 存储库中有许多应用程序。我想在我的应用程序之间共享一些库。
这是我的目录结构:
.
├── libs
│ └── messages
| ├── package.json
| ├── src
| ├── tsconfig.json
| └── ...all other good things for a library
├── main
│ ├── config
│ ├── dist
│ ├── node_modules
│ ├── package.json
│ ├── package-lock.json
│ ├── src
│ └── tsconfig.json
├── README.md
└── server
├── main.ts
├── node_modules
├── package.json
├── package-lock.json
├── setupEnvVars.js
├── src
└── tsconfig.json
我想将库“message”添加到我的项目“main”中,所以我尝试以这种方式添加它:
{
"name": "me",
"version": "1.0.0",
"main": "index.js",
"private": true,
"dependencies": {
"@me/messages": "../libs/messages/"
}
}
我被卡住了,因为它不起作用(但也不会引发错误)。你能帮助我吗?谢谢!
【问题讨论】:
标签: javascript typescript npm yarnpkg