'Npm run server doest work/ cant run server with


command "npm run serve" doest work, and i get this:

npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\user/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\user\package.json'
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: <>br npm ERR! C:\Users\user\AppData\Local\npm-cache_logs\2022-02-24T23_43_08_331Z-debug-0.log

I tried reinstalling/ installing the node, npm, i tried and didnt work:
npm config set ignore-scripts false



Solution 1:[1]

It looks like you are executing NPM from your user home directory. You need to run it in a project directory, and then run npm init, along with the corresponding npm install <X> commands. Do not run init if the project is already initialized.

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 0xLogN