Selenium-wd2 error "npm ERR! 'cp' is not recognized" windows10 [solved]

I believe this is the main error:
npm ERR! 'cp' is not recognized as an internal or external command

Here's the node-red plugin I'm trying and failing to install via node-red pallette-install

Help is much appreciated! :slightly_smiling_face:
full error log from windows cmd:

26 Jun 21:31:30 - [info] Installing module: node-red-contrib-selenium-wd2, version: 0.1.6
26 Jun 21:31:34 - [warn] Installation of module node-red-contrib-selenium-wd2 failed:
26 Jun 21:31:34 - [warn] ------------------------------------------
26 Jun 21:31:34 - [warn] npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! code 1
npm ERR! path C:\Users\Bgates\.node-red\node_modules\node-red-contrib-selenium-wd2
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c cp ./patch/http.js ../selenium-webdriver/lib/
npm ERR! 'cp' is not recognized as an internal or external command,
npm ERR! operable program or batch file.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Bgates\AppData\Local\npm-cache\_logs\2022-06-26T18_31_34_191Z-debug.log

26 Jun 21:31:34 - [warn] ------------------------------------------
Error: Install failed
    at C:\Users\Bgates\AppData\Roaming\npm\node_modules\node-red\node_modules\@node-red\registry\lib\installer.js:285:25
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
26 Jun 21:31:34 - [error] Error: Install failed
26 Jun 21:35:19 - [info] Stopping flows
26 Jun 21:35:19 - [info] Stopped flows```

The cp command only works in PowerShell on Windows unless you have installed some UNIXy commands.

I don't know the selenium node - is the command something you've set up or something internal to the node? If the latter, you will need to contact the author of that node and get them to fix it.

1 Like

Thanks for the reply, PowerShell didn't work neither,
But I made new Ubuntu 20 server and Nodejs 14 and this selenium plugin now works.
now I remeber why its not good idea to go with latest tech on software :smiley:

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.