Error with npm

Hi,

I got this error when installing with npm

AppData\Roaming\npm\node_modules\n8n\node_modules\mmmagic>if not defined npm_config_node_gyp (node “C:\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\…\node_modules\node-gyp\bin\node-gyp.js” rebuild ) else (node “C:\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js” rebuild )
gyp ERR! find VS
gyp ERR! find VS msvs_version not set from command line or npm config
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS checking VS2019 (16.4.29709.97) found at:
gyp ERR! find VS “C:\Program Files (x86)\Microsoft Visual Studio\2019\Community”
gyp ERR! find VS - “Visual Studio C++ core features” missing
gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
gyp ERR! find VS looking for Visual Studio 2015
gyp ERR! find VS - not found
gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
gyp ERR! find VS
gyp ERR! find VS **************************************************************
gyp ERR! find VS You need to install the latest version of Visual Studio
gyp ERR! find VS including the “Desktop development with C++” workload.
gyp ERR! find VS For more information consult the documentation at:
gyp ERR! find VS GitHub - nodejs/node-gyp: Node.js native addon build tool
gyp ERR! find VS **************************************************************

Hello @n8n_newbie, welcome to the community!

Honestly no idea. What command are you running? Just npm install n8n -g or npx n8n?

I especially do not understand why it would complain so much about Visual Studio when you install n8n! Are you kind of trying to install n8n inside of some kind of special Visual Studio environment/terminal/…? If so I would advise you to install Node.js v10 or higher directly on your computer and then also install n8n via the regular terminal. Also, make sure to install the build tools just to be sure it has everything npm install -g windows-build-tools.

Hello @jan it’s npm install n8n -g under powershell with admin rights, I have VSStudio 2019 and it seems to ask for VSStudio 2017 why?

Sorry have no experience at all with power shell so can not be much of a help here as I use Linux and not Windows. Actually the question is not why it asks for version 2017 instead of 2019 it is already why it cares about it at all.

Can you maybe use n8n with Docker instead?

@n8n_newbie if you still have the same problem please check the troubleshooting here. That should hopefully help you to get n8n running on windows:

It looks as though the installer is looking for a specific version of Visual Studio and it does not recognize the 2019 version. My guess is is trying to recompile the mmmagic package but can’t find the VS2017 compiler to do this.

I would suggest taking a look at GitHub - nodejs/node-gyp: Node.js native addon build tool for some direction.