Ace tool breaks if you run "npm ci --production" in the root folder (by mistake) #3649
stringfold
started this conversation in
Ideas
Replies: 1 comment
-
Hey @stringfold! 👋🏻 When you add the flag This is expected behavior. Also, the error is straightforward. It tells you that it cannot find a specific package, which happens since you "removed" it using the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was thinking about opening an issue, but since the problem was precipitated by a user error, I though a discussion was more appropriate, at least to start with.
My AdonisJS build environment broke when I began playing around with the deployment stage of my app and suddenly all the 'ace' commands stopped working, outputting the following error message:
Error: AdonisJS requires "@adonisjs/assembler" in order to run typescript source directly
Even worse, ace's build command disappeared altogether, not even listed anymore.
In my experience, when the build tools break, it's usually because I've been fiddling with the node/npm installations or the dependencies are broken, so I down a very long rabbit hole (several hours) trying to sort out the mess, but to no avail. I did eventually get everything working again, but it was only today after it happened again that I figured out that it was because I had run:
npm ci --production
in the project's root folder, instead of the build folder.
Fortunately, an "npm update" fixes the problem, but given how easy it is to make that mistake (mea culpa) and the fact that it breaks the 'ace' tool so badly, and in a not-so-easy to diagnose way, I'm wondering if there's a way of either preventing the errant command from running in the root folder -- e.g. triggering an exception instead -- or for ace to detect the problem and spit out a warning message instead of throwing up seemingly random error message.
The NodeJS tooling environment is wonderful when it's all working, but can be a real pain and take lots of time and Stack Overflow browsing to debug when something goes wrong. So if there's an easy way to detect this particular user error and split out a warning (even you still have to run 'npm update' to fix things, it would save people a lot time and head scratching in future.
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions