javascriptnode.jsnpmnpm-run

How to resolve lifecycle scripts issue?


I explain u all my process to have this error so :

  1. I create a folder for my project
  2. I open the terminal in the folder and i do the command npm init
  3. I create index.js file in the folder
  4. I do the command npm install
  5. I do the command npm run

When i do the npm run command i get this error

Lifecycle scripts included in dis_bot1@1.0.0:
  test
    echo "Error: no test specified" && exit 1

This is my package.json file

{
  "name": "dis_bot1",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC"
}

Solution

  • npm run needs an argument to determine which script to run.

    i.e. npm run test would run the test script defined in your package.json file.