-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
fix production postinstall #35
Conversation
Reverts 1d04a5. `build` requires @babel/cli, which is a dev dependency, so meteor-desktop install triggers errors in production.
When doing `npm i` inside meteor-desktop/ for the first time, dist/scripts/addToScripts doesn't exist. That doesn't matter as in such case, there's no package.json to which it would make sense to add the "desktop" script. Checking whether addToScripts exists first eliminates the useless error from the installation process.
@StorytellerCZ Could you please publish a rc.2 so that we can test whether the normal package installation now works correctly? As far as I'm concerned, if this issue is fixed, we can publish 3.1.1. Besides testing with skeleton projects, I successfully migrated our main project to 3.1.1-rc.0 and things seem to work properly. More tests are always welcome of course (especially on Windows). |
I'm getting the same error as you @dd137 when I upgrade to version 3.1.1-rc.1 I've went ahead and started building my Electron app locally but got the following error:
Any idea if this is related to the error you posted or is this a new one? The "request": "^2.88.2" for a while now, without any problems. I've just built a new version yesterday and my users aren't reporting any problems. |
@dd137 I'm heading out for a bit. Will merge and publish once I get back. |
Seems to be fixed now with rc.2!
This is unrelated. Do you have a By the way, I noticed that the |
Yes, it's coming from the Changing it to 2.88.2 solved the error and the app is now starting with the newest preview version locally. Thanks @dd137 and @StorytellerCZ |
As noted here, adding the meteor-desktop package to an npm project produces a
sh: babel: command not found
error. Full log:commit 1:
While this doesn't prevent the installation of the package, it is annoying. This happens since 3.1.1-rc.0. I believe it is due to 1d04a58 which added
npm run build
to thepostinstall
script. I don't think this is correct –build
should run before publishing or after changes in dev, not after a normal package installation. I propose to revert this change.commit 2:
postinstall
'snpm run build
allowedaddToScripts.js
to run even after a simplenpm i
inside meteor-desktop/ (for dev purpose). But as far as I can see, it doesn't make sense to runaddToScripts.js
in such cases, because if we're not adding meteor-desktop to another project, there's nopackage.json
addToScripts.js
needs to modify.That being said, a side benefit was also to prevent
postinstall
from logging aMODULE_NOT_FOUND
error when runningnpm i
inside meteor-desktop/ for the first time. So to keep that behavior while avoidingrun build
s in normal package installs, the 2nd commit simply checks foraddToScripts.js
's existence before running it (at the cost of an additional prod dependency).