1

I've been using npm for 2 years now, and I just went through it today and I saw a problem.

There is no error in console when I run npm scripts but it doesn't do anything.

It just starts and ends in one or two second whatever I run.

enter image description here

Here is a example package.json:

"scripts": {
    "dev": "npm run development",
    "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch": "npm run development -- --watch",
    "watch-poll": "npm run watch -- --watch-poll",
    "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
    "prod": "npm run production",
    "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
}

There is no problem with what it's inside into the scripts but I have the problem with running them because they stop running in one second.

EDIT: I've also tried this problem with react. When I run npm start this script also isn't going to be executed by npm.

How can I fix this problem?

0 Answers0