By CraigSau
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?
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!
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
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.