-2

How can I resolve this error(When i use npm run setup)?

npm ERR! missing script: setup

This is my scripts in my package.json:

"scripts": {
    "ng": "ng",
    "start": "ionic serve",
    "build": "ionic build",
    "build:prod": "NODE_ENV=production ionic build --prod",
    "build:test": "NODE_ENV=testing ionic build",
    "dev:android": "ionic cordova run android --livereload",
    "dev:ios": "ionic cordova run ios",
    "prod:android": "NODE_ENV=production ionic cordova run android --prod",
    "prod:ios": "NODE_ENV=production ionic cordova run ios --prod",
    "test": "NODE_ENV=testing gulp && jest --verbose",
    "test:ci": "NODE_ENV=testing gulp && jest -ci --runInBand --verbose",
    "test:watch": "NODE_ENV=testing gulp watch & jest --watch",
    "test:coverage": "NODE_ENV=testing gulp && jest --coverage",
    "lint": "NODE_OPTIONS=--max-old-space-size=4096 ng lint",
    "ionic:serve:before": "gulp",
    "ionic:serve": "./scripts/serve.sh",
    "ionic:build:before": "gulp"
  }
  • My nvm version is: 0.38.0

  • My npm version is: 6.7.0

  • My node version is: v11.15.0

  • My system is macBook


Edit: This is the setup documentaion that I'm following

RobC
  • 22,977
  • 20
  • 73
  • 80
jo jo
  • 1,758
  • 3
  • 20
  • 34

2 Answers2

1

A script named setup does not exist in package.json for the latest release of moodleapp (v3.9.5).

However, version v3.9.4 of moodleapp does include the following setup script in package.json:

...
"scripts": {
  ...
  "setup": "npm install && npx cordova prepare && npx gulp".
  ...
},
...

Perhaps the Setup the environment section of the docs is outdated.

Use version 3.9.4 of moodleapp instead.

RobC
  • 22,977
  • 20
  • 73
  • 80
0

I think your script is not serve but ionic:serve; So try running npm run ionic:serve

Lakshaya U.
  • 1,089
  • 1
  • 5
  • 21