Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node ReferenceError: X2JS is not defined ?? #46

Open
vaughanc-zz opened this issue Jan 14, 2017 · 2 comments
Open

Node ReferenceError: X2JS is not defined ?? #46

vaughanc-zz opened this issue Jan 14, 2017 · 2 comments

Comments

@vaughanc-zz
Copy link

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 );

@IrynaBu
Copy link

IrynaBu commented Mar 26, 2018

+1

@remmel
Copy link

remmel commented Mar 22, 2021

npm package x2js is another lib, it looks like you should use npm i x2js-fork

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants