can not add local package
See original GitHub issueExpected Behavior
when i run
lerna add module-0 --scope=module-1
it should link to module-1
Current Behavior
but npm is output error message, it tell me
lerna notice cli v3.13.1
lerna info filter [ 'module-1' ]
lerna info Adding module-0 in 1 package
lerna notice filter including "module-1"
lerna info filter [ 'module-1' ]
lerna WARN bootstrap Installing local packages that do not match filters from registry
lerna info Bootstrapping 1 package
lerna info Installing external dependencies
lerna ERR! npm install --no-save exited 1 in 'module-1'
lerna ERR! npm install --no-save stderr:
npm ERR! code ENOVERSIONS
npm ERR! No valid versions available for module-0
but when i run
lerna add module-0
it linked others successfully
lerna.json
{
"packages": [
"packages/*"
],
"version": "1.0.0"
}
module-0/package.json
{
"name": "module-0",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
module-1/package.json
{
"name": "module-1",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"module-0": "1.0.0"
}
}
file tree
βββ lerna.json
βββ package.json
βββ packages
βββ module-0
βΒ Β βββ index.js
βΒ Β βββ package.json
βββ module-1
βΒ Β βββ index.js
βΒ Β βββ package.json
βββ module-2
βββ index.js
βββ package.json
Your Environment
Executable | Version |
---|---|
lerna --version |
3.13.1 |
npm --version |
6.4.1 |
node --version |
8.12.0 |
OS | Version |
---|---|
macOS Sierra | 10.12.1 |
Issue Analytics
- State:
- Created 5 years ago
- Reactions:9
- Comments:13 (2 by maintainers)
Top Results From Across the Web
How to import local packages in go? - Stack Overflow
Well, I figured out the problem. Basically Go starting path for import is $HOME/go/src. So I just needed to add myapp in front...
Read more >Import Local Swift Package in Xcode 13.3 - Apple Developer
In the file list on the left, right-clicked on "Packages" -> "Add Packages ..." -> "Add Local" and selected the root directory of...
Read more >How to add local Swift Package as dependency?
The proper way to add a local Swift Package is via menu in Xcode: Swift Packages -> Add Package Dependency... And type the...
Read more >How to add local Swift Packages to an iOS project
Learn how to add local dependencies to your iOS project by using the Swift Package Manager and Xcode.
Read more >Golang Import Local Package - Linux Hint
Since we do not have any external packages, the file contains the module name and the go version. Golang Create Package. As mentioned,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am sorry, but I still think this issue applies. Or at least additional descriptions in documentation would be niceβ¦
If I am pointing to a local package
bar
in a packagefoo
like:and I run
lerna bootstrap
it will not install bar in node_modules of foo.However, if I run
lerna bootstrap --scope foo
it will install the local dependency as expected.If I use the
lerna add bar --scope=foo
to add it, it will add the dependency like this(as if it was installed remotely from the npm registry):and it will work as expected.
As someone already pointed out, I really find a lack of documentation here - it was really hard to figure out how to do it properly and know that Lerna was actually symlinking and using the local package.
Iβd gladly contribute and add a PR for update documentation, but I am still not entirely sure I get how it works soβ¦
@luponZ I can confirm your solution works, however, I would like to know why. From my understanding it should also work with
--scope
. Maybe this should be reopened because it is a bug?