Skip to content
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

[BUG] npm install installs the wrong things #3606

Closed
1 task done
danieltroger opened this issue Aug 3, 2021 · 10 comments
Closed
1 task done

[BUG] npm install installs the wrong things #3606

danieltroger opened this issue Aug 3, 2021 · 10 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release

Comments

@danieltroger
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When I install parcel parcel fails to run with this error:

@parcel/workers: Expected constructor 2.0.0-nightly.793+91287030:BundleGraph to be registered with serializer to deserialize

  Error: Expected constructor 2.0.0-nightly.793+91287030:BundleGraph to be registered with serializer to deserialize
  at /private/tmp/parcel-fukd/node_modules/@parcel/core/lib/serializer.js:228:15
  at memoizedFn (/private/tmp/parcel-fukd/node_modules/@parcel/core/lib/serializer.js:100:13)
  at mapObject (/private/tmp/parcel-fukd/node_modules/@parcel/core/lib/serializer.js:173:16)
  at restoreDeserializedObject (/private/tmp/parcel-fukd/node_modules/@parcel/core/lib/serializer.js:222:10)
  at deserialize (/private/tmp/parcel-fukd/node_modules/@parcel/core/lib/serializer.js:258:10)
  at Child.handleRequest (/private/tmp/parcel-fukd/node_modules/@parcel/workers/lib/child.js:204:31)
  at Child.messageListener (/private/tmp/parcel-fukd/node_modules/@parcel/workers/lib/child.js:108:19)
  at ThreadsChild.onMessage (/private/tmp/parcel-fukd/node_modules/@parcel/workers/lib/child.js:84:12)
  at ThreadsChild.handleMessage (/private/tmp/parcel-fukd/node_modules/@parcel/workers/lib/threads/ThreadsChild.js:59:10)
  at MessagePort.<anonymous> (/private/tmp/parcel-fukd/node_modules/@parcel/workers/lib/threads/ThreadsChild.js:53:61)
⠋ Bundling...

Apparently the issue is

Is it not a bug in npm? parcel depends on a pinned @parcel/core nightly. Why is it installing an rc version? It works properly with Yarn...

So parcel depends on a pinned package and npm is installing the wrong version.

Expected Behavior

NPM installs the right version and parcel works like it should.

Steps To Reproduce

  1. In the environment listed at the end of Parcel doesn't work at all anymore (@parcel/workers: Expected constructor 2.0.0-nightly.793+91287030:BundleGraph to be registered with serializer to deserialize) parcel-bundler/parcel#6675
  2. Download the .zip file from Parcel doesn't work at all anymore (@parcel/workers: Expected constructor 2.0.0-nightly.793+91287030:BundleGraph to be registered with serializer to deserialize) parcel-bundler/parcel#6675
  3. Run npm install and npm run build
  4. See error

@parcel/workers: Expected constructor 2.0.0-nightly.793+91287030:BundleGraph to be registered with serializer to deserialize

  Error: Expected constructor 2.0.0-nightly.793+91287030:BundleGraph to be registered with serializer to deserialize
  at /private/tmp/parcel-fukd/node_modules/@parcel/core/lib/serializer.js:228:15
  at memoizedFn (/private/tmp/parcel-fukd/node_modules/@parcel/core/lib/serializer.js:100:13)
  at mapObject (/private/tmp/parcel-fukd/node_modules/@parcel/core/lib/serializer.js:173:16)
  at restoreDeserializedObject (/private/tmp/parcel-fukd/node_modules/@parcel/core/lib/serializer.js:222:10)
  at deserialize (/private/tmp/parcel-fukd/node_modules/@parcel/core/lib/serializer.js:258:10)
  at Child.handleRequest (/private/tmp/parcel-fukd/node_modules/@parcel/workers/lib/child.js:204:31)
  at Child.messageListener (/private/tmp/parcel-fukd/node_modules/@parcel/workers/lib/child.js:108:19)
  at ThreadsChild.onMessage (/private/tmp/parcel-fukd/node_modules/@parcel/workers/lib/child.js:84:12)
  at ThreadsChild.handleMessage (/private/tmp/parcel-fukd/node_modules/@parcel/workers/lib/threads/ThreadsChild.js:59:10)
  at MessagePort.<anonymous> (/private/tmp/parcel-fukd/node_modules/@parcel/workers/lib/threads/ThreadsChild.js:53:61)

Environment

  • OS: macOS 10.15.7 (19H1217)
  • Node: 16.6.0
  • npm: 7.19.1
@danieltroger danieltroger added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Aug 3, 2021
@simllll
Copy link

simllll commented Aug 4, 2021

We experience something similar when a package-lock is existing.
The first npm install works perfectly fine, but the 2nd npm install or npm ci results into ERESOLVE overriding peer dependency issues and it seems indeed like wrong packages are installed (our eslint throws weird error messages and so on).

This is only happening with npm 7.20.3.. earlier versions do not have this issue. Right now this is especially a problem on our CI pipeline, as we use the latest npm version there. We have a quite big monorepo in use with the workspace feature.

@suits-at
Copy link

suits-at commented Aug 4, 2021

We experience something similar when a package-lock is existing.
The first npm install works perfectly fine, but the 2nd npm install or npm ci results into ERESOLVE overriding peer dependency issues and it seems indeed like wrong packages are installed (our eslint throws weird error messages and so on).

This is only happening with npm 7.20.3.. earlier versions do not have this issue. Right now this is especially a problem on our CI pipeline, as we use the latest npm version there. We have a quite big monorepo in use with the workspace feature.

This is the regarding debug log
2021-08-04T09_40_43_512Z-debug.log

npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @hokify/[email protected]
npm WARN Found: @hokify/[email protected]
npm WARN node_modules/@hokify/shared-components
npm WARN   @hokify/shared-components@"^1.1.17" from @hokify/[email protected]
npm WARN   packages/applicant-overview-components
npm WARN     @hokify/[email protected]
npm WARN     node_modules/@hokify/applicant-overview-components
npm WARN 
npm WARN Could not resolve dependency:
npm WARN @hokify/shared-components@"^1.1.17" from @hokify/[email protected]
npm WARN packages/applicant-overview-components
npm WARN   @hokify/[email protected]
npm WARN   node_modules/@hokify/applicant-overview-components
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @hokify/[email protected]
npm WARN Found: @hokify/[email protected]
npm WARN node_modules/@hokify/shared-components
npm WARN   @hokify/shared-components@"^1.1.17" from @hokify/[email protected]
npm WARN   packages/applicant-overview-components
npm WARN     @hokify/[email protected]
npm WARN     node_modules/@hokify/applicant-overview-components
npm WARN 
npm WARN Could not resolve dependency:
npm WARN @hokify/shared-components@"^1.1.17" from @hokify/[email protected]
npm WARN packages/b2b-job-stats-overview-components
npm WARN   @hokify/[email protected]
npm WARN   node_modules/@hokify/b2b-job-stats-overview-components
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @hokify/[email protected]
npm WARN Found: @hokify/[email protected]
npm WARN node_modules/@hokify/shared-components
npm WARN   @hokify/shared-components@"^1.1.17" from @hokify/[email protected]
npm WARN   packages/applicant-overview-components
npm WARN     @hokify/[email protected]
npm WARN     node_modules/@hokify/applicant-overview-components
npm WARN 
npm WARN Could not resolve dependency:
npm WARN @hokify/shared-components@"^1.1.17" from @hokify/[email protected]
npm WARN packages/b2b-relation-stats-components
npm WARN   @hokify/[email protected]
npm WARN   node_modules/@hokify/b2b-relation-stats-components
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @hokify/[email protected]
npm WARN Found: @hokify/[email protected]
npm WARN node_modules/@hokify/shared-components
npm WARN   @hokify/shared-components@"^1.1.17" from @hokify/[email protected]
npm WARN   packages/applicant-overview-components
npm WARN     @hokify/[email protected]
npm WARN     node_modules/@hokify/applicant-overview-components
npm WARN 
npm WARN Could not resolve dependency:
npm WARN @hokify/shared-components@"^1.1.17" from @hokify/[email protected]
npm WARN packages/chat-components
npm WARN   @hokify/[email protected]
npm WARN   node_modules/@hokify/chat-components
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @hokify/[email protected]
npm WARN Found: @hokify/[email protected]
npm WARN node_modules/@hokify/shared-components
npm WARN   @hokify/shared-components@"^1.1.17" from @hokify/[email protected]
npm WARN   packages/applicant-overview-components
npm WARN     @hokify/[email protected]
npm WARN     node_modules/@hokify/applicant-overview-components
npm WARN 
npm WARN Could not resolve dependency:
npm WARN @hokify/shared-components@"^1.1.17" from @hokify/[email protected]
npm WARN packages/email-templates
npm WARN   @hokify/[email protected]
npm WARN   node_modules/@hokify/email-templates
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @hokify/[email protected]
npm WARN Found: @hokify/[email protected]
npm WARN node_modules/@hokify/shared-components
npm WARN   @hokify/shared-components@"^1.1.17" from @hokify/[email protected]
npm WARN   packages/applicant-overview-components
npm WARN     @hokify/[email protected]
npm WARN     node_modules/@hokify/applicant-overview-components
npm WARN 
npm WARN Could not resolve dependency:
npm WARN @hokify/shared-components@"^1.1.17" from @hokify/[email protected]
npm WARN packages/file-preview-components
npm WARN   @hokify/[email protected]
npm WARN   node_modules/@hokify/file-preview-components
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @hokify/[email protected]
npm WARN Found: @hokify/[email protected]
npm WARN node_modules/@hokify/shared-components
npm WARN   @hokify/shared-components@"^1.1.17" from @hokify/[email protected]
npm WARN   packages/applicant-overview-components
npm WARN     @hokify/[email protected]
npm WARN     node_modules/@hokify/applicant-overview-components
npm WARN 
npm WARN Could not resolve dependency:
npm WARN @hokify/shared-components@"^1.1.17" from @hokify/[email protected]
npm WARN packages/hokifycv-components
npm WARN   @hokify/[email protected]
npm WARN   node_modules/@hokify/hokifycv-components
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @hokify/[email protected]
npm WARN Found: @hokify/[email protected]
npm WARN node_modules/@hokify/shared-components
npm WARN   @hokify/shared-components@"^1.1.17" from @hokify/[email protected]
npm WARN   packages/applicant-overview-components
npm WARN     @hokify/[email protected]
npm WARN     node_modules/@hokify/applicant-overview-components
npm WARN 
npm WARN Could not resolve dependency:
npm WARN @hokify/shared-components@"^1.1.17" from @hokify/[email protected]
npm WARN packages/invoice-components
npm WARN   @hokify/[email protected]
npm WARN   node_modules/@hokify/invoice-components
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @hokify/[email protected]
npm WARN Found: @hokify/[email protected]
npm WARN node_modules/@hokify/shared-components
npm WARN   @hokify/shared-components@"^1.1.17" from @hokify/[email protected]
npm WARN   packages/applicant-overview-components
npm WARN     @hokify/[email protected]
npm WARN     node_modules/@hokify/applicant-overview-components
npm WARN 
npm WARN Could not resolve dependency:
npm WARN @hokify/shared-components@"^1.1.17" from @hokify/[email protected]
npm WARN packages/job-poster-components
npm WARN   @hokify/[email protected]
npm WARN   node_modules/@hokify/job-poster-components
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @hokify/[email protected]
npm WARN Found: @hokify/[email protected]
npm WARN node_modules/@hokify/shared-components
npm WARN   @hokify/shared-components@"^1.1.17" from @hokify/[email protected]
npm WARN   packages/applicant-overview-components
npm WARN     @hokify/[email protected]
npm WARN     node_modules/@hokify/applicant-overview-components
npm WARN 
npm WARN Could not resolve dependency:
npm WARN @hokify/shared-components@"^1.1.17" from @hokify/[email protected]
npm WARN packages/legacy-invoice-components
npm WARN   @hokify/[email protected]
npm WARN   node_modules/@hokify/legacy-invoice-components
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @hokify/[email protected]
npm WARN Found: @hokify/[email protected]
npm WARN node_modules/@hokify/shared-components
npm WARN   @hokify/shared-components@"^1.1.17" from @hokify/[email protected]
npm WARN   packages/applicant-overview-components
npm WARN     @hokify/[email protected]
npm WARN     node_modules/@hokify/applicant-overview-components
npm WARN 
npm WARN Could not resolve dependency:
npm WARN @hokify/shared-components@"^1.1.17" from @hokify/[email protected]
npm WARN packages/login-stack
npm WARN   @hokify/[email protected]
npm WARN   node_modules/@hokify/login-stack
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @hokify/[email protected]
npm WARN Found: @hokify/[email protected]
npm WARN node_modules/@hokify/shared-components
npm WARN   @hokify/shared-components@"^1.1.17" from @hokify/[email protected]
npm WARN   packages/applicant-overview-components
npm WARN     @hokify/[email protected]
npm WARN     node_modules/@hokify/applicant-overview-components
npm WARN 
npm WARN Could not resolve dependency:
npm WARN @hokify/shared-components@"^1.1.17" from @hokify/[email protected]
npm WARN packages/pwa-core
npm WARN   @hokify/[email protected]
npm WARN   node_modules/@hokify/pwa-core
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/company-app - Not found
npm ERR! 404 
npm ERR! 404  'company-app@^1.1.20' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/sebi/.npm/_logs/2021-08-04T09_40_43_512Z-debug.log

@simllll
Copy link

simllll commented Aug 6, 2021

This gets quite serious, have to explciity stick to npm 7.20.2 now.
on production I suddenly got: Error: Cannot find module 'promise.any', due to npm 7.20.3 in the build pipeline

@danieltroger
Copy link
Author

I figured that npm is dead / unmaintained. The last triaged issue is from the beginning of june.

I just switched to yarn berry which is incredibly fast and works superb. Can recommend!

@folknor
Copy link

folknor commented Aug 8, 2021

I think the problem @simllll is describing is different. I have the same problem (original ticket description) with npm 7.20.2, 7.19, and 7.0.0. I've not tried npm 6.14.14 or earlier.

Even with full nukes of node_modules and package-lock.json and full reinstall of node_modules using the 3 different npm version.

@nlf
Copy link
Contributor

nlf commented Mar 8, 2022

we've made a lot of changes to peer dependency handling since this issue was opened. can any of you who are still experiencing this problem try installing [email protected] and let us know if it resolves your problem?

@folknor
Copy link

folknor commented Apr 15, 2022

@nlf Seems to work now using npm 8.7.0. I think this ticket can be closed.

@nlf
Copy link
Contributor

nlf commented Apr 27, 2022

closing as we've received a report that things are working. if this is incorrect please feel free to either reopen this issue or open a new issue for us

@nlf nlf closed this as completed Apr 27, 2022
@Junior-22
Copy link

Junior-22 commented Jun 16, 2022

Hi, I have just encountered a very similar problem

Environment

  • Edition: Windows 10 Home

  • Version: 21H1

  • OS build: 19043.1706

  • Experience: Windows Feature Experience Pack 120.2212.4170.0

  • Node: 16.14.2

  • npm: 8.12.2

  • Parcel: 2.0.0-rc.0

  • @parcel/transformer-sass: 2.0.0-rc.0

I get this error message from my console "Error: Expected constructor 2.0.0-rc.0:BundleGraph to be registered with serializer to deserialize"

How do I solve this so I can get my app working again?

@jteppinette
Copy link

jteppinette commented Nov 10, 2022

I was receiving this error. It was not due to npm. It was due to having mismatched parcel dependencies. i.e. anything @parcel/* should have the same version as parcel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

7 participants