Error while start npm

216 views
Skip to first unread message

Luiey

unread,
Oct 3, 2017, 10:54:43 PM10/3/17
to Node-RED
I'm using Windows 10 x64 and I have downloaded the Node-RED v0.17 from GitHub by downloading the zip and place into specific directory and extract the zip.

The downloaded Node-RED is from here.
The downloaded LTS NodeJS x64 msi is from here.

I have download some extra node from here to add extra node into the Node-RED flow node. And when running the command
npm start
in the red.js directory, the initializing of console log appear and there is some error happen. I want to know if it will affect the performance or stability of the Node-RED or it will be a problem to the node itself and the function it offers.

Some of the node is already install and if I just directly npm install again, does it will appear error too or it need to be update or uninstall and install back? 




Error specify:-

Welcome to Node-RED

===================

4 Oct 10:29:36 - [info] Node-RED version: v0.17.5

4 Oct 10:29:36 - [info] Node.js  version: v4.4.7

4 Oct 10:29:36 - [info] Windows_NT 10.0.15063 x64 LE

4 Oct 10:29:37 - [info] Loading palette nodes

4 Oct 10:29:39 - [warn] [modbustcp-no-pooling-server] Deprecated call to RED.runtime.nodes.registerType - node-set name

must be provided
as first argument

4 Oct 10:29:39 - [warn] [modbustcp-no-pooling-write] Deprecated call to RED.runtime.nodes.registerType - node-set name m

ust be provided
as first argument

4 Oct 10:29:39 - [warn] [modbustcp-no-pooling-read] Deprecated call to RED.runtime.nodes.registerType - node-set name mu

st be provided
as first argument

4 Oct 10:29:41 - [info] UI started at /ui

4 Oct 10:29:41 - [info] Dashboard version 2.5.1 started at /ui

4 Oct 10:29:42 - [warn] ------------------------------------------------------

4 Oct 10:29:42 - [warn] [rpi-gpio] Info : Ignoring Raspberry Pi specific node

4 Oct 10:29:42 - [warn] [tail] Not currently supported on Windows.

4 Oct 10:29:42 - [warn] [modbus rtu] Error: %1 is not a valid Win32 application.

\\?\C:\redjsworkspace\node_modules\serialport\build\Release\serialport.node

4 Oct 10:29:42 - [warn] [modbus tcp] Error: ModbusTCPConnection already registered (line:72)

4 Oct 10:29:42 - [warn] [OpcUa-Item] Error: Cannot find module '_generated_/_auto_generated_ServerStatus'

4 Oct 10:29:42 - [warn] [OpcUa-Client] Error: Cannot find module '_generated_/_auto_generated_ServerStatus'

4 Oct 10:29:42 - [warn] [OpcUa-Browser] Error: Cannot find module '_generated_/_auto_generated_ServerStatus'

4 Oct 10:29:42 - [warn] [OpcUa-Server] Error: Cannot find module '_generated_/_auto_generated_ServerStatus'

4 Oct 10:29:42 - [warn] [OpcUa-Event] Error: Cannot find module '_generated_/_auto_generated_ServerStatus'

4 Oct 10:29:42 - [warn] [modbus-serial] Error: %1 is not a valid Win32 application.

\\?\C:\redjsworkspace\node_modules\serialport\build\Release\serialport.node

4 Oct 10:29:42 - [warn] [ui_button] Error: ui_button already registered (line:67)

4 Oct 10:29:42 - [warn] [ui_switch] Error: ui_switch already registered (line:105)

4 Oct 10:29:42 - [warn] [ui_slider] Error: ui_slider already registered (line:36)

4 Oct 10:29:42 - [warn] [ui_numeric] Error: ui_numeric already registered (line:37)

4 Oct 10:29:42 - [warn] [ui_text_input] Error: ui_text_input already registered (line:34)

4 Oct 10:29:42 - [warn] [ui_text] Error: ui_text already registered (line:39)

4 Oct 10:29:42 - [warn] [ui_gauge] Error: ui_gauge already registered (line:76)

4 Oct 10:29:42 - [warn] [ui_chart] Error: ui_chart already registered (line:267)

4 Oct 10:29:42 - [warn] [ui_toast] Error: ui_toast already registered (line:50)

4 Oct 10:29:42 - [warn] [ui_template] Error: ui_template already registered (line:74)

4 Oct 10:29:42 - [warn] [ui_link] Error: ui_link already registered (line:11)

4 Oct 10:29:42 - [warn] [ui_tab] Error: ui_tab already registered (line:12)

4 Oct 10:29:42 - [warn] [mssql] Error: mssql already registered (line:88)

4 Oct 10:29:42 - [warn] [serialport] Error: %1 is not a valid Win32 application.

\\?\C:\redjsworkspace\node_modules\serialport\build\Release\serialport.node

4 Oct 10:29:42 - [warn] ------------------------------------------------------

4 Oct 10:29:42 - [info] Settings file  : \Users\TEM User\.node-red\settings.js

4 Oct 10:29:42 - [info] User directory : \Users\TEM User\.node-red

4 Oct 10:29:42 - [info] Flows file     : \Users\TEM User\.node-red\flows_DESKTOP-LNTLK26.json

4 Oct 10:29:42 - [info] Server now running at http://127.0.0.1:1880/

4 Oct 10:29:42 - [warn] Error loading credentials: SyntaxError: Unexpected token ?

4 Oct 10:29:42 - [info] Starting flows

4 Oct 10:29:42 - [info] Started flows



*** I have already install node-red-dashboard and I install node-red-contrib-ui. Does this make the error of ui node too? How to overcome Error: %1 is not a valid Win32 application error?

Luiey

unread,
Oct 3, 2017, 11:23:38 PM10/3/17
to Node-RED
UPDATED:-


I have uninstall the error node and the error has show less but still having some error. I have install modbus node that having the TCP and RTU. Instead, there only just TCP node only without RTU node. Within the folder, the RTU node is there. But not register to config. How to overcome this?

steve rickus

unread,
Oct 4, 2017, 8:43:39 AM10/4/17
to Node-RED
You cannot install both node-red-dashboard and node-red-contrib-ui. The contrib-ui modules are deprecated, and have been replaced by the dashboard module.

Some of the other errors seems to be coming from serialport and other nodes that require rebuilding since you installed a newer version of nodejs. Try cleaning the npm cache and rebuilding those modules. There is some upgrading documentation on the node-red site.

Luiey

unread,
Oct 4, 2017, 8:51:35 PM10/4/17
to Node-RED
Ok, for the serial port, it already solved based from the installation of serialport command that been found here.

npm install serialport --save-dev

I have uninstall all node that show the error and the console seems OK again.

Julian Knight

unread,
Oct 5, 2017, 6:13:23 AM10/5/17
to Node-RED
Hi, that is not the correct installation for Node-RED. 

As Steve pointed out, all you needed to do was to force a recompile because of your change of Node.JS versions. You really need to understand this because you will face the same issue in the future.

From the Node-RED upgrade documentation "You will also need to rebuild any nodes that have binary dependancies". You do this with:

cd ~/.node-red
npm rebuild

What you did certainly fixed one problem by forcing a rebuild of the serialport dependency but serialport is not a dev dependency and you haven't fixed the underlying problems.

Luiey

unread,
Oct 6, 2017, 12:04:53 AM10/6/17
to Node-RED
Hi JK,

Oh. Does it mean, when I'm installing using "npm install", I need to rebuild if the error regarding what steve has point out occur? How to know which node has "binary dependancies" based from the Upgrading documentation?

Last time I have perform a "npm update" to the directory of Node-RED and every setting that have been made in the index.mst is revert to default template together with the favicon.ico when I'm trying to upgrade the Node-RED version from 0.12 to 0.14 and above, in order to use the node-red-node-dashboard. *** I have download the Node-RED from Git into specific directory instead of global installation.

Luiey

unread,
Oct 6, 2017, 12:09:47 AM10/6/17
to Node-RED

Does the rebuild should be look like this?





On Thursday, 5 October 2017 18:13:23 UTC+8, Julian Knight wrote:

Julian Knight

unread,
Oct 6, 2017, 4:32:50 PM10/6/17
to Node-RED
Hmm, you seem to have a few problems here. 

I would recommend cleaning out your node_modules folder for now (assuming you don't have any custom code in there). 
Use a package.json in your redjsworkspace folder (I assume that is set as your userDir folder - if it isn't, then it is the userDir folder you need to be doing all this in) so that you have all the Node-RED dependencies ready to reinstall - leave out the github version of dashboard for now. 
Then do a "npm cache clean" and then delete the node_modules folder.
Next you should do "npm install --global windows-build-tools" which will get you all of the compile tools into the right place - this is one of the exceptions to the rule that you shouldn't install globally. I'm assuming that the Windows userid you are using has local admin rights.
Now you should be ready to do "npm install".

That should give you a working version of Node-RED complete with serial port. In the future, as long as you remember to keep your package.json file up to date, you can do an npm rebuild when you hit a new version of Node.js and npm update any other time. npm outdated tells you what needs updating.

To deal with a custom compile of Dashboard, I would recommend cloning the github repo to a completely different folder. Then cd into that folder and follow the build instructions. Finally LINK that folder into your \redjsworkspace\node_modules folder. You can use npm link, mklink or any other method you like, they all work. I use a File Explorer addin which saves having to remember what order the link parameters go in!

Doing it that way keeps the Dashboard build steps separate from your running instance of Node-RED. In the future, you need only rebuild the dashboard custom folder, your main userDir folder should only ever need npm update unless you've changed node.js versions.

Luiey

unread,
Oct 9, 2017, 9:04:32 PM10/9/17
to Node-RED
Hmmm, what a bad mess I come into with what I have practically do this all way wrong. Apologize on that.

Correct my thought on what you have advise:- What should I be practicing is, I need to let the node-red install in my computer as default [refer image below] without changing to userDir like from here and let the default node_modules downloaded. Then, whatever custom node/node that I downloaded manually should be install in user directory [C:\Users\{$USER}\.node-red] so it will be inserted into node_modules that already created there.

## Do you have any video tutorial on youtube or vimeo for this? If my thought was wrong, I can follow the best practice to use node-red based from recommendation guide

Julian Knight

unread,
Oct 12, 2017, 3:43:25 AM10/12/17
to Node-RED
You don't need to apologise! We've all been there.

You haven't quite got it right.

You can define your own userDir if you like, just remember to translate the location when you see something like "~/.node-red".

Secondly, when you want to do some coding on a node, I recommend putting it wherever you normally put code you are working - NOT in the userDir.
To make it available to your Node-RED instance, you then LINK the code folder into ~/.node-red/node_modules. npm has a link command (which you would run from ~/.node-red) but you can use mklink (on Windows) or ln (on Linux). To compile anything you need to in the code, you go to the code folder and do it there. Similarly, you need to install any dependencies there as well. That means that you don't need to do anything in ~/.node-red folder (unless you want to install a "normal" node that you are not going to work on the code).

So if you are working on the Dashboard, you might clone it from github into c:\src\node-red-node-dashboard. Then cd to ~/.node-red and do "mklink /d .\node_modules\node-red-node-dashboard c:\src\node-red-node-dashboard". Switch back to c:\src\node-red-node-dashboard and do npm install to install any dependencies (will also install dev dependencies) and you can then do a build. After the build, you can restart node-red and all should be good.

Luiey

unread,
Oct 12, 2017, 8:46:10 PM10/12/17
to Node-RED
Ok JK, this part
 
So if you are working on the Dashboard, you might clone it from github into c:\src\node-red-node-dashboard. Then cd to ~/.node-red and do "mklink /d .\node_modules\node-red-node-dashboard c:\src\node-red-node-dashboard". Switch back to c:\src\node-red-node-dashboard and do npm install to install any dependencies (will also install dev dependencies) and you can then do a build. After the build, you can restart node-red and all should be good.

are very clear on how you have said. I have understand on it. I will follow this approach from now. Thanks
Reply all
Reply to author
Forward
0 new messages