Question

Build Error: Non-Zero Exit from node_modules file.

I am getting a build error when attempting to run a script from a dependency to build my website.

$ node ace build
Debugger attached.

TypeError: commandInstance.exec is not a function


1 Kernel.execMain
  /Users/craigsau/Documents/Programming Stuff/PersonalSite/node_modules/@adonisjs/core/node_modules/@adonisjs/ace/build/src/Kernel/index.js:201

2 Kernel.handle
  /Users/craigsau/Documents/Programming Stuff/PersonalSite/node_modules/@adonisjs/core/node_modules/@adonisjs/ace/build/src/Kernel/index.js:528

3 App.handle
  /Users/craigsau/Documents/Programming Stuff/PersonalSite/node_modules/@adonisjs/core/build/src/Ignitor/Ace/App/index.js:226

4 Ace.handle
  /Users/craigsau/Documents/Programming Stuff/PersonalSite/node_modules/@adonisjs/core/build/src/Ignitor/Ace/index.js:33

However, this error is fixed by changing commandInstance.exec(); to commandInstance.exec; and runs successfully locally after making the change.

The problem lies that this is in node_modules, which is a gitignored file, and I believe it should stay that way. Is there any way to fix this without unignoring the node_modules?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello,

It sounds like it might be due to incompatible Node.js version.

What version of Adonis.js are you using? Based on that, I could suggest trying to use the supported Node.js version.

Then you can specify the Node.js version in your package.json file as follows:

{ 
  "engines" : { 
    "node" : "16.0.0" 
  }
}

Make sure to change the "16.0.0" version accordingly.

Let me know how it goes!

Best,

Bobby