'I get error when running npm start in vs code

(node:6852) [LRU_CACHE_OPTION_maxAge] DeprecationWarning: The maxAge option is deprecated. please use options.ttl instead
(Use `node --trace-deprecation ...` to show where the warning was created)

> [email protected] start
> node ./bin/www

npm ERR! code ENOENT
npm ERR! syscall spawn C:\Windows\system32\cmd.exe;C:\MinGW\bin
npm ERR! path C:\Users\TECHNOCITY9645075247\Desktop\web designing\myNodejsApp
npm ERR! errno -4058
npm ERR! enoent spawn C:\Windows\system32\cmd.exe;C:\MinGW\bin ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\TECHNOCITY9645075247\AppData\Local\npm-cache\_logs\2022-03-13T10_44_05_635Z-debug-0.logenter code here

this is the error showing in the terminal my node and npm versions are upto date



Solution 1:[1]

Try to reinstall Node.js. Should work as it worked for me.

Uninstalling the Node.js

  1. Clear the npm cache by running the following command in your terminal.

    npm cache clean --force

  2. Go to the windows control panel and click on Uninstall a program, select Node.js and click on uninstall tab to uninstall the node and npm successfully.

Restart your system.

  1. Verify if node.js and npm are completely uninstalled from your system using:

    node -v

If the above command prints command not found then you’re successfully uninstalled, otherwise look into the below directories and remove the contents manually.

C:\Program Files (x86)\Nodejs
C:\Program Files\Nodejs
C:\Users\{User}\AppData\Roaming\npm (or %appdata%\npm)
C:\Users\{User}\AppData\Roaming\npm-cache (or %appdata%\npm-cache)

Solution 2:[2]

Looks you're facing the problem of using maxAge instead of expires look at this link Can't set cookie 'expires' or 'maxAge' in Node.js using Express 3.0

Maybe help you for better resolution into the issue.

Solution 3:[3]

Try to reinstall Node.js. Should work as it worked for me.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Anil Maurya
Solution 2 Nafis
Solution 3