Skip to content

[BUG] npm install installs the wrong things #3606

@danieltroger

Description

@danieltroger

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next stepsRelease 7.xwork is associated with a specific npm 7 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions