question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

npm install --save hoodie: do not overide "start" script in package.json

See original GitHub issue

when installing hoodie, it runs a setup in postinstall. Among other things, it sets the “start” script (via https://github.com/hoodiehq/hoodie/pull/592)

But if the “start” script is already set, it currently gets overwritten, which it shouldn’t do

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
gr2mcommented, Nov 20, 2016

Sure, give it a try! The relevant line is this one: https://github.com/hoodiehq/hoodie/blob/8fa80e1b1ac192c18766b2d8e189529f8c003029/bin/setup.js#L18: Instead of simply setting packageJson.scripts[ 'start' ] we should check if packageJson.scripts[ 'start' ] is already set. If it is

  1. do not set it to 'hoodie' and and add a log.info('setup', 'start script already set to "' + packageJson.scripts[ 'start' ] + ', you can start hoodie with "npm run start-hoodie" instead
  2. set packageJson.scripts[ 'start-hoodie'] to hoodie instead.

Makes sense?

0reactions
gr2mcommented, Dec 25, 2016
Read more comments on GitHub >

github_iconTop Results From Across the Web

Don't set "hoodie-start" script if "start" script is set to "hoodie" · Issue ...
now, remove the "dependencies" key from your package.json and rm -rf node_modules. Leave the "start": "hoodie" line and run npm install --save hoodie...
Read more >
Override `npm install` script for NPM project - Stack Overflow
I tried using this in package.json: "scripts": { "ng": "ng", "start": ...
Read more >
[Solved]-overriding package.json scripts - NPM-node.js
You can't "override" package.json because the filename is hardcoded in NPM. You can create another script entry like: "scripts":{ "dev": "yarn dev:build" ...
Read more >
13 npm Tricks for Faster JavaScript Development - Medium
In this article, we'll discuss 13 tricks to get the most out of npm: from simple shortcuts to custom npm init scripts. Since...
Read more >
@material-ui/lab | Yarn - Package Manager
This package hosts the incubator components that are not yet ready to move to core . Installation. Install the package in your project...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found