-
-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
preferLocal
option does not run dependencies of dependencies
#169
Comments
@AndyOGo could you please provide steps to reproduce the issue? |
I think I now understand your problem, let me rephrase it: the I don't think this is an issue. The way
@sindresorhus can we close this issue? |
preferLocal
option does not run dependencies of dependencies
@ehmicky Right, it's about nested dependencies. To be clear we release a node package called So it's about the dependencies of the dependent node package. Node provides the perfect API for this case already by Please let me make the point clear, that |
Ok I think I see what you're trying to do with Now I must be missing something because For example, let's say:
Under that setup, when Please let me know what I'm missing here. Note: shouldn't you call Note 2: you might consider other projects like |
@ehmicky Thanks for your quick answer. I agree, and I also thought that We use Indeed, you are right, would also be possible to call Nevertheless this is an issue for all nested npm packages not being resolved by |
Could you share your setup? I am still not understanding how you're having an issue there. I assume the following assumptions to be true:
Which of the assumptions are wrong? If one of them is wrong, could please provide your setup? FYI |
I quickly revised my understanding. As per NPM docs seems that only locally installed dependencies are available for
Here is one of our public setups:
The issue is that executing |
npm docs says that The setup you provided above does not produce any issues for me. Reproducible steps: $ git clone https://github.com/axa-ch/patterns-library.git
$ cd patterns-library
$ npm install
$ vim node_modules/@axa-ch/generic-release/lib-release.js
$ npm run release
> @axa-ch/patterns-library@2.0.1-beta.264 release /home/ehmicky/patterns-library
> generic-release docs dist
Node-Version 1.7.0
A command line node module to deal with "bumping" and "npm version"
It should be execute into a folder with a package.json file
Usage: version [options]
Options:
--help
Print the help around the command
-i --increment [<level>]
Increment a version by the specified level. Level can
be one of: major, minor, patch, premajor, preminor,
prepatch, or prerelease. Default level is 'patch'.
Only one version may be specified. A Git commit and
tag will be created.
Nota Bene: it will use the "npm version" command if the option
"read-only" is not activated.
-p --preid <identifier>
Identifier to be used to prefix premajor, preminor,
prepatch or prerelease version increments. It could
be 'snapshot', 'beta' or 'alpha' for example.
--force-preid
If specified, we force to add if needed the specified preid
--read-only
Print only the future version. Don't modify the package.json file,
nor the npm-shrinkwrap.json file, don't create a commit and don't
create a git tag
--nogit-commit
No git commit
--nogit-tag
No git tag
--git-create-branch
Create a new branch. Does not work if a preid is generated.
--git-push
Push the commit, the branch and the tags if needed
-u --unpreid
Remove the prefix. The increment and preid option will be ignored.
Only a Git commit will be created
--read-only
Print only the future version. Don't modify the package.json file,
nor the npm-shrinkwrap.json file, don't create a commit and don't
create a git tag
--nogit-commit
No git commit
--nogit-tag
No git tag
--git-create-branch
Create a new branch. Does not work if a preid is generated.
--git-push
Push the commit, the branch and the tags if needed
🚀 Hello Dear developer, welcome to the release assistant. 🚀
!! Please make sure you have no changes to be commited !!
I'm getting some information....
>>> resolved | npm whoami
>>> resolved | npm owner ls
Attention: Your account ehmicky has no publisher rights. Please contact the administrator In the #!/usr/bin/env node
const readline = require('readline');
const outdent = require('outdent');
const execa = require('execa');
+ console.log(execa.sync('npmversion').stdout) I.e. I don't think there is an issue with |
Thank you so much for looking into this and investing your valuable time. Please watch out, as I said I declared Without that it would not work. |
If you remove
|
Interesting, I observe other behaviour. Which OS are you using? We need to support Windows, Linux and macOS I received this ENOENT error: proceed: to proceed with the above described steps. This operation cannot be undone!
proceed
>>> resolved | git checkout develop --quiet
>>> resolved | git pull
>>> resolved | git checkout -b release-tmp --quiet
Step 1 complete...
>>> resolved | npm run test
>>> rejected | npmversion --increment prerelease --preid beta --force-preid --nogit-commit --nogit-tag
Error: spawn npmversion ENOENT |
I am on Linux. OS difference might be a thing, because |
I'm on macOS, most people are on Windows |
Alright if you're on macOS, there should be no difference in how I think the next step at this stage would be to get a minimally reproducible example. The setup above is quite complex and could be reduced to smaller parts. |
Dependencies of locally installed packages aren't found and thus cause ENOENT errors.
May I guess local node modules aren't resolved like
require.resolve
?It throws:
A workaround is to add the needed package as
peerDependencies
, so that the package is directly available at the consumer, like is done here https://github.com/axa-ch/generic-release/pull/24/filesThe text was updated successfully, but these errors were encountered: