How to solve “404-cannot find module” error on Node.js V12

By | October 28, 2021

Node.js is an open source, cross-platform runtime environment for server-side and networking applications. Node.js applications are written in JavaScript, and can be run within the Node.js runtime on OSX, Microsoft Windows, Linux.

Node.js on Sage X3:

We come across scenario where x3 require integration with Node.js. It increases the efficiency of the development process as it fills the gap between frontend and backend applications.NodeJS module can be created by copying the JS code to the Syracuse folder that stores the modules.

Node. Js is faster because it is asynchronous and single-threaded. This means that all I/O operations don’t block any other operations.JavaScript code is also executed in the process main thread while all other I/O operations are executed in separate threads which results in almost no delays.

Error:404 cannot find module:

This blog helps in rectifying status code :404 cannot find module ‘syracuse-httpclient/lib/httpClient’ error, while executing Node.js through X3.

Status Code 404:

A 404-error message is a Hypertext Transfer Protocol (HTTP) status code indicating the server could not find the requested website. In other words, web browser can connect with the server, but the specific page we are trying to access can’t be reached.

Or the file or page that the browser is requesting wasn’t found on the server.

Sage x3, Node.js, Gumu file starts with the header as mentioned on below Fig 02

On V11, To identity the httpclient we can declare

var httpClient =require(“syracuse-httpclient/lib/httpClient”);

Solution for above error:

but in V12 we have to declare

var httpClient = require(“@sage/syracuse-lib/src/http-client/httpClient”);

Function calls the web service with httpClient.httpRequest. Then it checks the status code and parses the reply with jsxml. parse. It then extracts the result byBody.

This blog helps us in understanding integration of Node.js with X3 and solving status code: 404-cannot find module on syracuse-httpclient/lib/httpClient’ node.js on V12.

About Us

Greytrix – a globally recognized and one of the oldest Sage Development Partners is a one-stop solution provider for Sage ERP and Sage CRM organizational needs. Being acknowledged and rewarded for multi-man years of experience and expertise, we bring complete end-to-end assistance for your technical consultations, product customizations, data migration, system integrations, third-party add-on development, and implementation competence.

Greytrix has some unique integration solutions developed for Sage CRM with Sage ERPs namely Sage X3Sage IntacctSage 100Sage 500, and Sage 300. We also offer best-in-class Sage ERP and Sage CRM customization and development services to Business Partners, End Users, and Sage PSG worldwide. Greytrix helps in the migration of Sage CRM from Salesforce | ACT! | SalesLogix | Goldmine | Sugar CRM | Maximizer. Our Sage CRM Product Suite includes addons like  Greytrix Business Manager, Sage CRM Project Manager, Sage CRM Resource Planner, Sage CRM Contract Manager, Sage CRM Event Manager, Sage CRM Budget Planner, Gmail Integration, Sage CRM Mobile Service Signature, Sage CRM CTI Framework.

Greytrix is a recognized Sage Champion Partner for GUMU™ Sage X3 – Sage CRM integration listed on Sage Marketplace and Sage CRM – Sage Intacct integration listed on Sage Intacct Marketplace. The GUMU™ Cloud framework by Greytrix forms the backbone of cloud integrations that are managed in real-time for the processing and execution of application programs at the click of a button.

For more information on our integration solutions, please contact us at sage@greytrix.com. We will be glad to assist you.