Problemas no npm ao executar o rfbrowser init

Boa noite pessoal!
Gostaria de saber se alguém consegue me ajudar com este problema…
Após instalar a biblioteca Browser, quando executo o rfbrowser init está retornando o seguinte problema:
File “C:\Python312\Lib\subprocess.py”, line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command ‘[‘npm’, ‘-v’]’ returned non-zero exit status 1.

Acima tem a parte do erro específico (para facilitar), aqui abaixo vou colocar o retorno completo.
$ rfbrowser init
2023-11-18 19:33:02,936 [INFO ] ==============================================================================================================
2023-11-18 19:33:02,936 [INFO ] Installing node dependencies…
O sistema não pode encontrar o caminho especificado.
2023-11-18 19:33:03,378 [INFO ] Couldn’t execute npm. Please ensure you have node.js and npm installed and in PATH.See https://nodejs.org/ for documentation
2023-11-18 19:33:03,379 [INFO ] ==============================================================================================================
2023-11-18 19:33:03,381 [INFO ] Traceback (most recent call last):
File “C:\Python312\Lib\site-packages\Browser\entry.py”, line 324, in init
_rfbrowser_init(skip_browsers, silent_mode, with_deps, browser)
File “C:\Python312\Lib\site-packages\Browser\entry.py”, line 131, in _rfbrowser_init
_check_npm()
File “C:\Python312\Lib\site-packages\Browser\entry.py”, line 123, in _check_npm
raise exception
File “C:\Python312\Lib\site-packages\Browser\entry.py”, line 111, in _check_npm
subprocess.run(
File “C:\Python312\Lib\subprocess.py”, line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command ‘[‘npm’, ‘-v’]’ returned non-zero exit status 1.

Agradeço desde já.

Josiane, the communication here is in English.

But I can already say something:

  • Your problem is related to the rfbrowser installer not finding NodeJS npm
    (npm is the command to install and run node modules)
  • Other thing might be the version of Python. I don’t know if Browser is compatible with Python 3.12
  • You should move this message to the Topic Browser

Boa Sorte

Thanks. I Will try The indicated solutions.

Good afternoon!
I redid the installation of node and python, both with compatible versions, but the error still persists.
Python is installed in the c: folder, outside the programs folder and node is installed in the c://programas folder.
I tried to put them both on the same route (just c:// or just c://programs) but the same thing persists. Do you have any other instructions that could help me please? Thanks.

I am not an expert on Browser. Maybe @mkorpela or @aaltat can help you.

Are you sure Browser is compatible with Python 3.12?

Yes it is compatible. Thank you for your help. @mkorpela or @aaltat Can you help me with this problem please?

Hi Josiane,

From your error

 Couldn’t execute npm. Please ensure you have node.js and npm installed and in PATH

Since it appears you are using windows, try typing

echo %PATH%

and see if the node folder is in the path?

Also you can try running

npm -?

This should give you the npm help screen:

npm <command>

Usage:

npm install        install all the dependencies in your project
npm install <foo>  add the <foo> dependency to your project
npm test           run this project's tests
npm run <foo>      run the script named <foo>
npm <command> -h   quick help on <command>
npm -l             display usage info for all commands
npm help <term>    search for help on <term>
npm help npm       more involved overview

If it doesn’t then the issue is not a browser library issue.

Also a tip, if you had the command line window open before you installed NodeJS, then the path update that NodeJS installer should have done won’t have been applied to your command window (this is how windows works), you should keep all the command windows closed when installing NodeJS and python, then open a new command window after the installs are finished to get the path updates.

Hope that helps,

Dave.