# Xml2js problem registering

**URL:** <https://discourse.nodered.org/t/xml2js-problem-registering/6831>\
**Category:** General\
**Created:** [15 January 2019 07:25 UTC](https://discourse.nodered.org/t/xml2js-problem-registering/6831 "2019-01-15T07:25:57Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ukjay](https://avatars.discourse-cdn.com/v4/letter/u/258eb7/32.png) [@ukjay](https://discourse.nodered.org/u/ukjay)\
**Post date:** [15 January 2019 07:25 UTC](https://discourse.nodered.org/t/xml2js-problem-registering/6831/1 "2019-01-15T07:25:57Z")

</div>

I'm not having any luck installing xml2js  
Can you help?  
Here is some info 👎  
This is the flow address

BBC Weather To Twitter  
[https://flows.nodered.org/flow/0d98ac57a6ebf724def9](https://flows.nodered.org/flow/0d98ac57a6ebf724def9)

It requires xml2js, I've installed it with npm, but as you can see below there is a problem??

15 Jan 07:07:52 - [info] Waiting for missing types to be registered:  
15 Jan 07:07:52 - [info] - xml2js

pi@raspberrypi:~/.node-red $ npm list  
node-red-project@0.0.1 /home/pi/.node-red  
├─┬ node-red-dashboard@2.13.0

further down  
│ │ └── ms@2.0.0 deduped  
│ └── isarray@2.0.1 deduped  
└─┬ xml2js@0.4.19  
├── sax@1.2.4  
└── xmlbuilder@9.0.7

Please help - thanks  
Jay

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [15 January 2019 08:16 UTC](https://discourse.nodered.org/t/xml2js-problem-registering/6831/2 "2019-01-15T08:16:33Z")

</div>

Solving that isn't unfortunately going to give you what you want, as the BBC have changed their feed structure.

The URL in that data now just gives

```auto
<?xml version="1.0" encoding="UTF-8"?><rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"> <channel> <atom:link href="http://open.live.bbc.co.uk/weather/feeds/en/NE16/3dayforecast.rss" rel="self" type="application/rss+xml" /> <title>BBC Weather - Forecast for NE16, United Kingdom</title> <link>http://www.bbc.co.uk/weather/ne16</link> <description>3-day forecast for NE16 from BBC Weather, including weather, temperature and wind information</description> <language>en</language> <copyright>Copyright: (C) British Broadcasting Corporation, see http://www.bbc.co.uk/terms/additional_rss.shtml for more details</copyright> <pubDate>Thu, 01 Jan 1970 01:00:00 +0100</pubDate> </channel></rss>

```

Rather than the 3 day forecast.

The new structure is described here [https://www.bbc.co.uk/weather/about/17543675](https://www.bbc.co.uk/weather/about/17543675) including the Terms of Use.

You can use the standard pre-installed `xml` node to do the work of the missing xml2js component.  
Attach a debug and then using the tooltips described here [https://nodered.org/docs/user-guide/messages](https://nodered.org/docs/user-guide/messages)

You should be able to find and copy the paths to the pieces of the messages you want.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [15 January 2019 08:25 UTC](https://discourse.nodered.org/t/xml2js-problem-registering/6831/3 "2019-01-15T08:25:06Z")

</div>

@ukjay in addition to the response from @ukmoose, which is absolutely correct, I thought I'd add a comment on why the xml2js node isn't appearing.

You have tried to install the `xml2js` npm module. This is the raw node.js module and not a Node-RED node module. I started this reply expecting to point you, for educational purposes, at the appropriate node-red node module to install. But it appears that whatever module provided that node no longer exists!

Given the changes to the BBC website and the lack of xml2js node to install, that example flow isn't very useful anymore. I've removed it from the flow library.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [15 January 2019 08:42 UTC](https://discourse.nodered.org/t/xml2js-problem-registering/6831/4 "2019-01-15T08:42:47Z")

</div>

Our built in XML node contains the xml2js npm library.

---

<div class="post-metadata">

**Author:** ![ukjay](https://avatars.discourse-cdn.com/v4/letter/u/258eb7/32.png) [@ukjay](https://discourse.nodered.org/u/ukjay)\
**Post date:** [15 January 2019 09:18 UTC](https://discourse.nodered.org/t/xml2js-problem-registering/6831/5 "2019-01-15T09:18:17Z")

</div>

Thanks everyone for the fast & helpful responses!  
After I posted, I looked at the package-lock.json file  
I then did npm i sax & also xmlbuilder & I'm sure they installed ok, but the package file now says it requires sax as a dependency again??  
Anyway, not to worry all this is helping me understand node-red a bit more, all I want is a good example of a tweet node that works ....

Jay

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [15 January 2019 09:23 UTC](https://discourse.nodered.org/t/xml2js-problem-registering/6831/6 "2019-01-15T09:23:20Z")

</div>

the built in Twitter node should work...

---

<div class="post-metadata">

**Author:** ![ukjay](https://avatars.discourse-cdn.com/v4/letter/u/258eb7/32.png) [@ukjay](https://discourse.nodered.org/u/ukjay)\
**Post date:** [15 January 2019 10:55 UTC](https://discourse.nodered.org/t/xml2js-problem-registering/6831/7 "2019-01-15T10:55:26Z")

</div>

Yes it has thanks, I even tweeted something, so that's a start

Jay

---

<div class="post-metadata">

**Author:** ![ukjay](https://avatars.discourse-cdn.com/v4/letter/u/258eb7/32.png) [@ukjay](https://discourse.nodered.org/u/ukjay)\
**Post date:** [15 January 2019 16:58 UTC](https://discourse.nodered.org/t/xml2js-problem-registering/6831/8 "2019-01-15T16:58:49Z")

</div>

Tweeting OK

> <https://twitter.com/UkJay1/status/1085218917780463617>

Jay  
(would be better if the data was for Stoke-on-Trent though)

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [15 January 2019 17:26 UTC](https://discourse.nodered.org/t/xml2js-problem-registering/6831/9 "2019-01-15T17:26:06Z")

</div>

You might want to read the terms of use…
