Skip to content

npm update for 3.2.0 fails on Windows 10: can't find postinstall.js #4380

@anders8

Description

@anders8

Description

I've been using model-viewer for a year with no trouble in an Angular app, this shows up only with the new 3.2.0 release. I see that there's a new script... but it's not being found. Take a look at where it's trying to find it though: is it about two directories too high?

Perhaps there's a difference between OSs where the previous command is leaving the working directory?

Perhaps there's a slight OS difference in the working directory for the command vs the execution?
"postinstall": "if [ -f '../../scripts/postinstall.js' ]; then node ../../scripts/postinstall.js; fi",

I assume that the intent here is to be finding
D:_mystuff_\node_modules@google\model-viewer\scripts\postinstall.js

But if I do a
npm pack --dry-run @google/model-viewer
there isn't a scripts directory, or the postinstall.js script coming down anywhere. And to that, one could reasonably say "well, it's only supposed to try to run it if it finds it" and yeah, I don't have an answer for you there.

Additional notes:

  • same result with and without the "three" package installed
  • same result in cmd and powershell, regular user and admin
  • same result for npm update and npm install if I scrap node_modules and package_lock
image

Version

  • model-viewer: v3.2.0

Browser Affected

None, npm install issue

OS

  • Windows 10

Env

npm: 9.6.7
node: 18.12.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions