'Can't run Node.js server local

I can't npm run watch I don't know the problem

Error message



Solution 1:[1]

Most of the time it happened because some packages didn't install correctly. to fix that run "npm install".

Please add more info in the question like what error you get or what step you did.

Solution 2:[2]

I guess, there is Cross-env is not installed in your environment..

delete node_modules DIR and try

npm i

npm i -g cross-env

Solution 3:[3]

I guess you can use a dotenv-webpack plugin to use the env variable in webpack. https://www.npmjs.com/package/dotenv-webpack

npm i dotenv-webpack

In your webpack.config.js

plugins: [ new Dotenv({ path: path.resolve(__dirname,'./.env.dev'), })]

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 Raphael Ben Hamo
Solution 2 Community
Solution 3 Sushant Kargwal