3

I was trying to run this SVELT GitHub repo on local server:

https://github.com/fusioncharts/svelte-fusioncharts

I tried to launch it with "npm run dev" command. But I am seeing this error:

npm ERR! missing script: dev

I have tried to fix the issue by setting 'ignore-scripts' to false with this command:

npm config set ignore-scripts false

But it doesn't work.

How can I fix the issue?

7
  • Did you run npm i after you cloned it, like they state in the docs? Commented Apr 20, 2021 at 9:19
  • 2
    The package.json does not have a script named dev Commented Apr 20, 2021 at 9:21
  • If you look on repo package.json under scripts, you can see that script name is "prepublishOnly" and its property are npm run dev, you can do npm prepublishOnly Commented Apr 20, 2021 at 9:21
  • 1
    There is no dev script in the package.json. At this point you should open an issue to ping maintainers to clarify the README. Commented Apr 20, 2021 at 9:23
  • @ASDFGerte yes. Commented Apr 20, 2021 at 9:23

5 Answers 5

5

npm ERR! missing script: dev means there isn't a script having dev. You are likely running on an incorrect directory.

Fusion charts seem to work with svelte codesandbox.

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, that's right. I have to go inside "examples" folder. I fixed the issue even before getting your answer. Nonetheless, thank you very much for taking your time looking at my issue.
1

npm ERR! missing script: dev means it cannot find a script called dev inside package.json.

That makes sense!

It looks at the package.json inside the svelte-fusioncharts repo. In that file, there is a scripts property.

Notice how that property looks as follows:

"scripts": {
  "build": "rollup -c",
  "prepublishOnly": "npm run build"
}

It does not contain a dev script. That’s why it says there’s a missing script. Other commands will work, like npm run build or npm run prepublishOnly.

Comments

0

Md. Ehsanul Haque Kanan,

  "scripts": {
"build": "cross-env NODE_ENV=production webpack",
"dev": "webpack-dev-server --content-base public" }

The above is the script from the examples folder in the repo: https://github.com/fusioncharts/svelte-fusioncharts/blob/develop/examples/package.json

You have missed out on the "dev" script in your package.json file.

Please check the "package.json" file in your project and just add the "dev" script as in the repo link and then retry.

1 Comment

I’ve added an answer below. If that doesn’t help, someone else ran into a similar problem on the GitHub repository: github.com/fusioncharts/svelte-fusioncharts/issues/11 — If you’re still stuck getting in touch with them via GitHub may help
0

Alright. I have fixed the issue. I just go inside examples folder. Then I run the following commands:

npm install
npm run dev

Comments

0

I had the same problem. It is due to changes in script object in package.json by me. I had installed nodemon and to run the code, I changed the script lifecycle events start and dev in package.json to run the code via nodemon. But even after installing nodemon, it was not reflecting in devDependencies, so I made manual entry in package.json with its version seeing from package-lock.json.

  "devDependencies": {
    "nodemon":"^2.0.15"
  }

Making this arrangement, my code started as expected. So, check your recent npm package installation and verify its reflection in devDependencies or dependencies in package.json.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.