npm run does nothing at Svelte startup

I was getting back to Svelte for a small project and ran into a strange issue. npm run dev did not run the svelte app as expected - no output or errors.

First I create a new project.

npx degit sveltejs/template awesome-project-1
cd awesome-project-1
npm i
npm run dev

And, I get greeted with nothing. I did not have any errors or output to debug.

tldr;

Set config ignore-scripts to false and retry.

npm config set ignore-scripts false

That’s it!

More information that no one asked for

The commands executed by run dev did not help as well.

node node_modules\rollup\dist\rollup -c -w

But, npm start worked without issues (but that does not have hot reloading).That gave me an idea but I do not understand rollup to dig further into the issue.

I first tried using webpack bundler instead of rollup.

npx degit sveltejs/template-webpack svelte-webpack
npm i
npm run dev

This worked just fine.

After trying a bit to change rollup configuration to output anything at all, it came back to me - I had set ignore-scripts to true after listening to a security expert talk on node security. The configuration will ignore post install scripts and I was fine with that.

Apparently, this has a different effect on rollup.

Set the config back to false ran everything as expected.

npm config set ignore-scripts false

I don’t understand rollup enough and do not know what the issue is. But I will stick to webpack for now and retain ignore-scripts config with npm.

comments powered by Disqus