Npm Install Missing Folder/File

Describe the problem/error/question

Lots of warnings then error when trying to run a fresh self hosted install of n8n on Windows 11 Pro using npm. I have checked the location for the missing file but the folder does not exists. I have tried the install process multiple times but the folder does not get created.

What is the error message (if any)?

C:\Windows\System32>npm install -g n8n
npm WARN deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
npm WARN deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated [email protected]: Please switch to @apidevtools/json-schema-ref-parser
npm WARN deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated [email protected]: dommatrix is no longer maintained. Please use @thednp/dommatrix.
npm WARN deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated @oclif/[email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated @azure/[email protected]: A newer major version of this library is available. Please upgrade to the latest available version.
npm WARN deprecated @azure/[email protected]: A newer major version of this library is available. Please upgrade to the latest available version.

changed 1215 packages in 41s

C:\Windows\System32>n8n
    Error: Cannot find module
    'C:\Users\<USER>\AppData\Roaming\npm\node_modules\n8n\node_modules\cache-manager\dist\index.js'. Please verify
    that the package.json has a valid "main" entry
    Code: MODULE_NOT_FOUND

![npm|690x184](upload://e9HCOJUUi98qzk6fun3n5IOek8L.jpeg)


Share the output returned by the last node

  • n8n version: 1.16.0
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own, main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: Windows 11 Pro 23H2 Build 22631.2715
  • node.js version: 18.18.2
  • npm versions tested: 9.8.1 & 10.2.4

Hey @Suratwala,

Which version of node are you using? I would also recommend using the Docker version where possible as that includes other components that you may not have available on your desktop.

Hi @Jon,

I have tested with node 18.18.2 and npm 9.8.1 & 10.2.4.

This started happening on an existing setup so tried a fresh install to see if it was the machine but same issue. I don’t know much about Docker and am not comfortable using it. I have tried Docker previously but didn’t have much luck.

Hey @Suratwala,

Sadly I am out of ideas already on this one as npm should grab everything, We use the same npm package in our docker images so the only difference would be Windows.

I will see if I can find a Windows internally to give this a test.

Thanks @Jon ,

I would really appreciate it as I have a lot of workflows on my existing setup.

Hey @Suratwala,

I had a quick chat and they are going to test later today but they did a global install yesterday using npm and didn’t have any issues so it could be something funky with NPM today or something specific to your environment.

Once we have tested again I will let you know.

1 Like

Just want to add to this conversation. I’m having the same issue in an Ubuntu 20.04 machine (in my case n8n: 1.16.0, node.js: 18.16.0, npm: 9.5.1).

1 Like

Hi @Jon,

Just an FYI - just tested on a fresh install of Windows 10 with same versions of node and npm and got the same issue. I have done this in the past and it worked without any issues the first time.

Temporarily, I just created a “dist” directory inside the cache-manager directory, and copied the files “index.js” and “index.d.ts” from n8n/dist and I was able to start n8n apparently without issues.

Just gave it a go on a linux box I have and I had the same issue, It looks like this issue could be out of our hands at the moment as it is caused by a cache-manager project. There is a GitHub issue here for it: 5.3.0 missing `dist/` folder on npmjs.org · Issue #611 · node-cache-manager/node-cache-manager · GitHub

Based on this I really would recommend the Docker image which has everything included.

“apparently” was the right word. I was migrating from a 0.x version, and upon start, I get “Init Problem: There was a problem loading init data: (0, cache_manager_1.caching) is not a function” so certainly, the cache_manager issue is still there…

So to follow up on this… This issue is becuase of this project and we are going to makea change to our packages so we don’t always use the latest version which will help prevent this in the future.

Downgrading the version of “cache-manager” (“cache-manager”: “~5.2.3” in the package.json file of n8n) and reinstalling did the trick fine and no issues now with running the workflows.

That is pretty much what we are doing and will be releasing 1.17.1 shortly to fix this.