Npm not able to find file

When I run npm run start on a centos 7 vps, I get the errors in the attached screenshot. What’s the best way to resolve this?

I checked with my hosting company and they said:

Blockquote

The error is happening because npm can’t find a package.json file within the directory that you’re running the command from. A “package.json” file is required for most nodejs applications since they tell node and npm, and other node modules, how to manage the application itself. This usually includes what versions of what modules the application needs in order to run, paths to any required files, as well as various other information about the application. More on this file can be found at the following URL: https://docs.npmjs.com/cli/v6/configuring-npm/package-json
If the file is not present then some commands like ‘npm run’ won’t execute properly.

Hey @Josh_Fialkoff!

Can you please let me know how are you trying to use n8n?

Here’s the guide that will help you setup n8n on the server using Docker Compose.

If you want to run n8n using npm, you need to install n8n as a global package using the command npm install n8n -g. You can read more about how to run n8n using npm following the documentation here.

Let me know this helps. :slightly_smiling_face:

Thanks! I think I need a developer at this point. :wink: Is there a directory of n8n developers?

If n8n was not initially installed as a global package, what steps do I need to take to make it global?

Execute this command:

npm install n8n -g

I hired a developer to do this and the setup is now complete! Thanks for all of your help @jan & @harshil1712.
I’m super excited to start using n8n now.

2 Likes