[Bug] Prestart scripts no longer run
See original GitHub issue- I’d be willing to implement a fix
Describe the bug
In both npm and yarn legacy, when running a script named xxx
, if a script named prexxx
exists it would be run beforehand. Likewise, a script named postxxx
would be run afterwards.
In yarn berry, this is no longer the case; prestart
, poststart
no longer work for custom script names.
To Reproduce
{
"name": "test-package",
"scripts": {
"prestart": "echo prestart",
"start": "echo start"
}
}
Screenshots
npm and yarn 1 work correctly:
yarn berry works incorrectly:
Sherlock repro
await packageJsonAndInstall({
"scripts": {
"prestart": "echo prestart",
"start": "echo start"
}
});
await expect(await yarn(`start`)).toContain(`prestart`);
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:6 (2 by maintainers)
Top Results From Across the Web
NVM for windows is failing when using npm prestart scripts
I have nvm-windows 1.1.9 latest installed. I have tried a machine recycle, re-installing nvm for windows, deleting the packages and modules and ...
Read more >telemetry-collector pre-start script times out and fails during ...
The pre-start script for the telemetry-collector job fails during an Apply Changes or deployment of the telemetry tile with a timeout error ......
Read more >scripts - npm Docs
Due to the lack of necessary context, uninstall lifecycle scripts are not implemented and will not function. User. When npm is run as...
Read more >Lifecycle Scripts | Yarn - Package Manager
Each time Yarn has to fetch a dependency from a "raw" source (such as a Git repository), it will automatically run yarn install...
Read more >npm start fails - Google Groups
3 info using no...@v6.10.0 4 verbose run-script [ 'prestart', 'start', 'poststart' ] ... 21 error Make sure you have the latest version of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This should also be specified in the migration guide, as it is an incredibly large difference from how things used to work, and will break many user scripts.
Now documented as of #1002