You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, not sure if I'm doing something wrong here but I'm getting the following issue "ReferenceError: X2JS is not defined". Any help would be greatly appreciated.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.
server:test chris$ node main.js
/Users/chris/scripts/tapps_proj/test/main.js:4
var x2js = new X2JS();
^
ReferenceError: X2JS is not defined
at Object. (/Users/chris/scripts/tapps_proj/test/main.js:4:16)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:420:7)
at startup (bootstrap_node.js:139:9)
at bootstrap_node.js:535:3
server:test chris$ cat main.js
require('x2js');
// Create x2js instance with default config
var x2js = new X2JS();
var xmlText = "Successval1val2";
var jsonObj = x2js.xml_str2json( xmlText );
The text was updated successfully, but these errors were encountered:
Hi, not sure if I'm doing something wrong here but I'm getting the following issue "ReferenceError: X2JS is not defined". Any help would be greatly appreciated.
Thanks
server:test chris$ cat package.json
{
"name" : "myapp",
"version" : "0.0.1",
"main" : "main.js",
"dependencies": {
"x2js": "^3.1.0"
}
}
server:test chris$ npm install x2js
[email protected] /Users/chris/scripts/tapps_proj/test
└── [email protected]
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.
server:test chris$ node main.js
/Users/chris/scripts/tapps_proj/test/main.js:4
var x2js = new X2JS();
^
ReferenceError: X2JS is not defined
at Object. (/Users/chris/scripts/tapps_proj/test/main.js:4:16)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:420:7)
at startup (bootstrap_node.js:139:9)
at bootstrap_node.js:535:3
server:test chris$ cat main.js
require('x2js');
// Create x2js instance with default config
var x2js = new X2JS();
var xmlText = "Successval1val2";
var jsonObj = x2js.xml_str2json( xmlText );
The text was updated successfully, but these errors were encountered: