New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue with peerDependencies coming from sinon and chai #144
Fix issue with peerDependencies coming from sinon and chai #144
Conversation
b97cdea
to
bd1d318
Compare
can you explain why this is required? |
@deleonn testing instructions should include verifying the lockfile does not have any changes after a fresh install / reinstall - can you update those 🙏 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I needed to do some research to understand the background of this PR. I found this helpful: https://stackoverflow.com/questions/66239691/what-does-npm-install-legacy-peer-deps-do-exactly-when-is-it-recommended-wh
The PR title makes it sound like chai
and sinon
are the underlying thing that is throwing this error. Is that because we're running older versions of these testing tools?
Specifically, npm outdated
shows:
Package Current Wanted Latest
chai 3.5.0 3.5.0 4.3.6
chai-as-promised 5.3.0 5.3.0 7.1.1
mocha 2.5.3 2.5.3 10.0.0
sinon 7.2.5 7.5.0 14.0.0
sinon-chai 3.3.0 3.7.0 3.7.0
If we were running newer versions of the tools that are throwing this error, would this problem go away?
If so, it seems like that would be a better route to addressing this error rather than using a cryptic legacy-peer-deps
flag that locks us into behavior from earlier versions of npm (>=4, <=6).
@joegoggins starting from npm@7, peerDependencies are now installed by default, which is what the I tried to upgrade all the related |
bd1d318
to
a5fe439
Compare
@busticated @joegoggins seems like the missing piece was adding |
@deleonn you'll need to dig deeper i think - run
then trace back those dependencies:
bottom-line: we're on a very old version of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i tested using npm
versions 8.5.5
, 8.11.0
, and 8.12.1
- looks good 👍
@deleonn for posterity, please update this PR's testing instructions per 👉 #144 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @deleonn , I'm stoked you were able to find a way to upgrade deps rather than use that funky flag. 👍
Description
The dependencies sinon-as-promised, sinon-chai and chai were causing issues due to peerDependencies now being installed by default and said packages pointing to incompatible dependency versions between them. The current problem is that simply updating them is breaking the
npm i
fornode@12
andnode@14
. In order to prevent this behavioreslint
was updated to version 8, which was asking for a different version ofacorn
.How to Test
bug/sc-104915/error-when-installing-dependencies-in-particle
v16.x
and npm to version tov8.x
. Usenvm use 16
or equivalent.node -v && npm -v
. Make sure you are runningnpm@8.6.x
or higher. This particular version is causing the package-lock.json to get modified after doing an installnpm i
ornpm run reinstall
package-lock.json
does not have changesnpm run test
Outcome
All tests should pass. npm i should run without issues.
Related / Discussions
Completeness
main
)