Download node modules(such as node-red-node-mysql) by using code

hello,everyone,i can use exec node to do something like remove a file in linux (example:rm xxx.txt), but it cant download a node module(like npm install node-red-node-mysql)

have a good way to do that?

What error does that return?

thank you for reply,return nothing, but download fail

Check the other outputs of the exec node.
Why are you using -g? Normally that would need sudo permissions to run. Also you have selected Append msg.payload, what have you got in the payload that you are appending to the command?

1 Like

As @Colin says, the Exec node has three output ports. Connect them all to a Debug node to see the output - any error messages from the command will be emitted from the second port.

1 Like

@knolleary error:

i did a test use js file , it can download!

:thinking::thinking:

You can see the command it is running has 155549101984 at the end.
That is because, just as @Colin said in his reply, you have the append msg.payload option enabled in the Exec node - so it is adding the timestamp from the Inject node to the end of the command.

Disable that option in the Exec node and it should work.

1 Like

thank you very much,i will try it

:sweat_smile: (my emotion now)

thank you very much