Node.js error (me problem, not wappler problem)

Hi all,

Having been learnig node and just trying to advance my skills (errors are an inevitability...)

I was trying to play with an npm package (any-text) and messed up my local project files to the point where the server would no longer run.

I've fixed that by copying all the non-user generated files from a blank project and the server now runs / functions correctly but i'm still getting a localweb server error:

node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'E:\My Drive\Wappler\arg2\node_modules\nodemon\bin\nodemon.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

This file path doesn't exist 'E:\My Drive\Wappler\arg2\node_modules\nodemon\bin\nodemon.js'
and doesn't in a standard project directory setup.

I'm sure this is a node dependancy or npm issue but not sure how to remove this error.
Its annoying and want to understand (the learning part...)

Any help would be gratefully appreciated and or advice.
Cheers Jon

On terminal run npm install

Thanks for your assistance
That gave me a whole bunch of errors with no change

PS C:\Windows\system32> Set-Location "E:\My Drive\Wappler\SAAS"
PS E:\My Drive\Wappler\SAAS> npm install
npm error code ENOTDIR
npm error syscall mkdir
npm error path E:\My Drive\Wappler\SAAS\node_modules\express\node_modules
npm error errno -4052
npm error ENOTDIR: not a directory, mkdir 'E:\My Drive\Wappler\SAAS\node_modules\express\node_modules'
npm error A complete log of this run can be found in: C:\Users\user\AppData\Local\npm-cache\_logs\2024-11-14T16_05_47_966Z-debug-0.log

I've tried running in wappler terminal and powershell with admin privelages.
Gives me the same result.
Anything else I can try?
Thanks again

How is the tree of your project?


:+1:

My question is, do you use Git?

no,
I know it looks like I do, but there have been no commits to this project, or set up of an actual repository.

Delete node_modules and package.json and hope Wappler creates it again

1 Like

When it says My drive, it's a cloud drive? Like google drive?
If so, move that to another location, it's not recommended to have it there.

1 Like

@Apple - tried that with no difference, the node_module folder hasnt been recreated but there is no change to the problem or the operation of the app?

@franse - In this instance It is, but it doesn't seem to make a difference whether it is located here or out of the drive on my machine. (it's a true local folder and i only turn google drive on to sync folders when i'm done at the end of a session) .

It doesnt seem to be affecting the operation of the local server or app, I would just like to understand the why?

If i make a completely blank node project its still throwing the same error which makes me think its more node server/npm related rather than my project or wappler per se.

I've tried updating node/npm after the problem appeared, but that hasn't changed anything either (the problem or my apps function)

I resorted to re-installing wappler but that has made no difference.

I appreciate your suggestions.
Got any more?....

Can you try creating a new project on a local folder which has no connection/relation with a cloud environment?
For example: e:\localfolder

Have you tried rebooting? Am sure Node sets some environmental paths which may require a reboot (on Windows) to take effect..?

Appologies for the delayed response (life and stuff) and thanks for the help.

I get the same error even if i make a new wappler node project anywhere on my system.

@franse I tried that and the same outcome is occuring, google drive doesn't seem to make a difference...... but big caveat it seems that npm throws errors wth folders directly in the Gdrive

Stack Overflow npm gdrive issues

Hopefully that may help someone in the future.

The only way I can seem to fix this is to directly run npm install in the folder. That seems to be for any project: old, new, in gdrive or out of gdrive.

It got rid of the error so I'm happy!
Thanks for the assistance as always from this helpful community.

1 Like