-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[BUG] Broken link in npm v7 series beta re. $npm_package_* environment variables (now gone) #2452
Comments
Apologize for the confusion. We'll try & get that fixed. |
So, what is the recommended approach for custom package variables referenced by scripts? Should the config object be used for this purpose? |
Yes, we this to automatically put docker tag and labels based on the values from package.json. It would be great to know how to circumvent the change and for the documentation to be up to date. |
@derekgreer scripts should read package.json directly. |
I've just spent most of an hour trying to find some documentation indicating why, with recent versions of npm, my run-scripts are now deprived of access to the configuration parameters in The latest npm documentation does not seem to mention it. I have not seen any warnings that this was going to happen, or that it was bad practice to use these. There are no articles mentioning this I can find searching the wider internet. Now I seem to have been put in the awkward position of needing to find a work-around and implementing it in all my npm projects. I hope you can sympathise if I admit to feeling a little exasperated! :) Can there please be some clear mention of this breaking change in the npm documentation, with advice as to a recommended work-around which will work both with older and newer versions of npm going forward? Or better, could there be a way of enabling the old behaviour (perhaps a parameter in package.json) so I don't have to rewrite? Thanks! |
@wu-lee it was a breaking change in npm v7, and is listed in https://blog.npmjs.org/post/626173315965468672/npm-v7-series-beta-release-and-semver-major and npm/rfcs#90. |
Indeed, but also:
I anticipate lots of other people are going to be caught out by the loss of this functionality, possibly in quite damaging ways, as shell scripts can do given an empty string where there was something else before. So it does seem to warrant at the very least a heads up for And this would likely save the NPM team some grief too. |
Certainly, at least, the github blog post should be updated to point to the proper RFC link (cc @ethomson). |
Apologies if this is the wrong repo; I don't know where to file this.
I was researching why after upgrading to npm 7 my $npm_package environment variables were blank, and found this blog post. It says,
Three issues,
The text was updated successfully, but these errors were encountered: