Search code examples
javascriptreactjsnpmpackaging

No npm scripts works from react project


I have a React application, that has been working fine for a long time suddenly none of the npm commands in the package.JSON file works.

{


 "name": "fitness-appication-frontend",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "react": "^16.10.2",
    "react-chat-ui": "^0.3.2",
    "react-dom": "^16.10.2",
    "react-scripts": "0.9.5"
  },
  "devDependencies": {},
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  }
}

whenever i try to run a npm command nothing happens in the terminal it just returns blank like such

kristoffer@kristoffer-ThinkPad-T570:~/Skrivebord/Fitness-Application/fitness-application-frontend$ npm start
kristoffer@kristoffer-ThinkPad-T570:~/Skrivebord/Fitness-Application/fitness-application-frontend$

Is anybody familiar with this issue?

It only happens when i try to run these commands, the built in ones, like npm installworks fine enough.

output of npm start run -dd

npm info it worked if it ends with ok
npm verb cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'start', '-dd' ]
npm info using npm@3.5.2
npm info using node@v8.10.0
npm verb run-script [ 'prestart', 'start', 'poststart' ]
npm info lifecycle fitness-appication-frontend@0.1.0~prestart: fitness-appication-frontend@0.1.0
npm info lifecycle fitness-appication-frontend@0.1.0~start: fitness-appication-frontend@0.1.0
npm info lifecycle fitness-appication-frontend@0.1.0~poststart: fitness-appication-frontend@0.1.0
npm verb exit

Solution

  • This happened because you have

    ignore-scripts=true
    

    From docs:

    ignore-scripts

    Default: false

    Type: Boolean

    If true, npm does not run scripts specified in package.json files.

    Check this link

    P.S. You may use git log <branch name> to check when this change was done