• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

npm ERR! missing script: start

Scheduled Pinned Locked Moved Troubleshooting
5 Posts 3 Posters 2.7k Views 3 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    Perlchamp
    last edited by May 12, 2020, 7:22 AM

    as the heading says, i have a problem starting my module. npm start causes the following error:
    npm ERR! missing script: start
    here is my package.json file:

    {
      "name": "emetalcharts",
      "version": "1.0.0",
      "description": "charting commodity prices",
      "main": "emetalcharts.js",
      "private": "true",
      "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1"
      },
      "repository": {
        "type": "git",
        "url": "git+https://github.com/sdetweil/SampleModule.git"
      },
      "author": "",
      "license": "MIT",
      "bugs": {
        "url": "https://github.com/sdetweil/SampleModule/issues"
      },
      "homepage": "https://github.com/sdetweil/SampleModule#readme",
      "dependencies": {
        "chart.js": "^2.5.0",
        "sqlite3": "^4.2.0"
      }
    }
    

    the following is recommended on many websites:

      "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1",
        "start" : "node ."
      },
    

    this then causes the following error message :

    Module.register("emetalcharts", {
    ^
    ReferenceError: Module is not defined
    

    I’m done. Who can help me ?
    could it also be a version conflict?
    my versions:

     $ node --version
    v10.20.1
    $ npm --version
    6.14.5
    

    Thanks in advance
    so long

    B 1 Reply Last reply May 12, 2020, 10:19 AM Reply Quote 0
    • B Offline
      bhepler Module Developer @Perlchamp
      last edited by May 12, 2020, 10:19 AM

      @Perlchamp - Did you run npm install inside the module folder?

      1 Reply Last reply Reply Quote 0
      • P Offline
        Perlchamp
        last edited by Perlchamp May 12, 2020, 10:31 AM May 12, 2020, 10:28 AM

        yes, of course. thank you
        this did install the node_module folder in my module folder

        L 1 Reply Last reply May 12, 2020, 10:36 AM Reply Quote 0
        • L Offline
          lavolp3 Module Developer @Perlchamp
          last edited by lavolp3 May 12, 2020, 10:36 AM May 12, 2020, 10:36 AM

          @Perlchamp Are you running npm start inside the module folder?
          I’m not an expert on this, but I think Module is a class that belongs to the MagicMirror environment. Your module as a standalone does not know what to do with it.
          If you run npm start in the MagicMirror folder, it would recognize the code.

          How to troubleshoot modules
          MMM-soccer v2, MMM-AVStock

          1 Reply Last reply Reply Quote 0
          • P Offline
            Perlchamp
            last edited by May 12, 2020, 10:37 AM

            yes, of course. thank you.

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            1 / 1
            • First post
              5/5
              Last post
            Enjoying MagicMirror? Please consider a donation!
            MagicMirror created by Michael Teeuw.
            Forum managed by Sam, technical setup by Karsten.
            This forum is using NodeBB as its core | Contributors
            Contact | Privacy Policy