GitXplorerGitXplorer
t

npm7-prepare-issue

public
0 stars
0 forks
0 issues

Commits

List of commits on branch main.
Verified
1b9b5f593d7b94f6cb86a618a56a151a00c0a7c7

Update README.md

ttimoxley committed 4 years ago
Verified
7c30efcc7ac41ad375a3bc1eb73cfe4cb928ce7c

Update README.md

ttimoxley committed 4 years ago
Verified
8746afc6f668465669106ad9221dd6c55f7ff0f5

Update README.md

ttimoxley committed 4 years ago
Verified
1fd68e023c6e7334639ee4e7186e8df6cbe7b398

Update README.md

ttimoxley committed 4 years ago
Verified
b8064b7c88a7625825e27af56199d2e74bdbe45e

Update README.md

ttimoxley committed 4 years ago
Verified
ade268f5dda6094eb0edefab3fbd07d0609c7cbd

Simplify to just a & b packages..

ttimoxley committed 4 years ago

README

The README file for this repository.

npm7-prepare-issue

A test case for npm 7's handling of prepare scripts in workspaces.

See: https://github.com/npm/cli/issues/3034

git clone git@github.com:timoxley/npm7-prepare-issue.git
cd npm7-prepare-issue
npm install # this will break
npm install # works on second run
# run this to clean up and try again
npm run clean

Key Things:

  1. apple depends on banana
  2. banana's prepare script sleeps for 2s, touches INSTALLED file, then runs banana/index.js
  3. banana/index.js checks for INSTALLED, then prints 'banana'
  4. apple's prepare script runs apple/index.js
  5. apple/index.js requires banana/index.js, checks for INSTALLED, then prints 'apple'

The problem is that when:

  • apple's prepare script runs
  • banana's prepare script is still sleeping so
  • apple's prepare script errors because banana's INSTALLED file hasn't been created yet.

Note: Using prepublish instead of prepare seems to work fine.