質問編集履歴
1
yarn add と yarn link も試した
test
CHANGED
File without changes
|
test
CHANGED
@@ -100,8 +100,78 @@
|
|
100
100
|
|
101
101
|
|
102
102
|
|
103
|
+
### `yarn add <git remote url>`
|
104
|
+
|
105
|
+
今回は開発時のみ使用したかったので、`yarn add https://bitbucket.org/myteam/prj-b --dev`としました。
|
106
|
+
|
107
|
+
すると、`package.json`の devDependencies に ` "prj-b": "https://bitbucket.org/myteam/prj-b",`が追加されました。
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
そうして、先ほどとを同様に prj-a から prj-b を呼び出し、先ほどと同様のエラーが出ました。
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
### `yarn link`
|
116
|
+
|
117
|
+
それでもダメだったので、`yarn link`を試しました。
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
```
|
122
|
+
|
123
|
+
$ cd ~/works/prj-b
|
124
|
+
|
125
|
+
$ yarn link
|
126
|
+
|
127
|
+
yarn link v1.2.1
|
128
|
+
|
129
|
+
warning You are using Node "9.1.0" which is not supported and may encounter bugs or unexpected behavior. Yarn supports the following semver range: "^4.8.0 || ^5.7.0 || ^6.2.2 || ^8.0.0"
|
130
|
+
|
131
|
+
success Registered "prj-b".
|
132
|
+
|
133
|
+
info You can now run `yarn link "prj-b"` in the projects where you want to use this module and it will be used instead.
|
134
|
+
|
135
|
+
✨ Done in 0.05s.
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
$ cd ../prj-a
|
140
|
+
|
141
|
+
$ yarn link "prj-b"
|
142
|
+
|
143
|
+
yarn link v1.2.1
|
144
|
+
|
145
|
+
warning You are using Node "9.1.0" which is not supported and may encounter bugs or unexpected behavior. Yarn supports the following semver range: "^4.8.0 || ^5.7.0 || ^6.2.2 || ^8.0.0"
|
146
|
+
|
147
|
+
success Using linked module for "prj-b".
|
148
|
+
|
149
|
+
✨ Done in 0.76s.
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
$ yarn list prj-b
|
154
|
+
|
155
|
+
yarn list v1.2.1
|
156
|
+
|
157
|
+
warning You are using Node "9.1.0" which is not supported and may encounter bugs or unexpected behavior. Yarn supports the following semver range: "^4.8.0 || ^5.7.0 || ^6.2.2 || ^8.0.0"
|
158
|
+
|
159
|
+
warning Filtering by arguments is deprecated. Please use the pattern option instead.
|
160
|
+
|
161
|
+
└─ prj-b@0.1.0
|
162
|
+
|
163
|
+
✨ Done in 0.99s.
|
164
|
+
|
165
|
+
```
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
そうして、先ほどとを同様に prj-a から prj-b を呼び出し、先ほどと同様のエラーが出ました。
|
103
170
|
|
104
171
|
|
105
172
|
|
106
173
|
|
174
|
+
|
175
|
+
## そのた
|
176
|
+
|
107
177
|
ちなみに、`prj-a`ではreact-create-app 使ってます。
|