google / model-viewer

Easily display interactive 3D models on the web and in AR!
https://modelviewer.dev
Apache License 2.0
6.84k stars 807 forks source link

`postinstall` script not found #4362

Closed subhankar-trisetra closed 1 year ago

subhankar-trisetra commented 1 year ago

Description

➤ YN0009: │ @google/model-viewer@npm:3.2.0 [58ced] couldn't be built successfully (exit code 1, logs can be found here: /tmp/xfs-dcba39bc/build.log)
➤ YN0007: │ trisetra-decor@workspace:. must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 6s 348ms
➤ YN0000: Failed with errors in 19s 639ms
# This file contains the result of Yarn building a package (@google/model-viewer@virtual:58ced34e477cff2c62a5e26ca6c375fed90e1af1a4fcc875901614bfd6afa62fbc58ffae3a1f03b621a96e23ef501c7dc5c56da1d8c169f9ff70fe73a6e888d7#npm:3.2.0)
# Script name: postinstall

node:internal/modules/cjs/loader:1078
  throw err;
  ^

Error: Cannot find module '/home/subhankar/workspace/trisetra-decor/node_modules/scripts/postinstall.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
    at Module._load (node:internal/modules/cjs/loader:920:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:23:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v18.16.0

This error pops up when I try to install @google/model-viewer with Yarn 2+. I works perfectly fine with "@google/model-viewer": "^3.1.1"

Version

Browser Affected

OS

KaiSoellch commented 1 year ago

same here

btopro commented 1 year ago

also confirming this happens with yarn 1.22.18. My yarn install has a postinstall which it appears that this project including the hook has it run as well. As I don't have that file in my setup it bombs

annahassel commented 1 year ago

same

jgalindosl commented 1 year ago

I was able to get it to work with the following workaround:

npm install --ignore-scripts

although, this will ignore scripts for all packages.

btopro commented 1 year ago

I'd recommend cutting a release off this as it breaks all tooling to install 3.2.0 currently

subho57 commented 1 year ago

I'd recommend cutting a release off this as it breaks all tooling to install 3.2.0 currently

@elalish Can you cut a release as v3.2.1 as a hotfix for this issue?

elalish commented 1 year ago

working on it, but we need a better fix: #4368, which isn't quite ready yet. See you on Monday.

cipas commented 1 year ago

hey @elalish any news on this? thanks

concman commented 1 year ago

same issue here, can't update the latest version of model-viewer through yarn, getting the same error

asilliahmet commented 1 year ago

same here as well, tried node 18.17 and 20.5's npms

pReya commented 1 year ago

While this is getting fixed, you can either use

npm i @google/model-viewer --ignore-scripts or you can install an older version: npm i @google/model-viewer@3.1.1

concman commented 1 year ago

Well, while it's working with yarn add @google/model-viewer --ignore-scripts locally, that can't be appropriate approach to push this code to remote repository, because CloudFlare is not going to download dependencies with the following script. That may cause problem.

elalish commented 1 year ago

Sorry, this turned into a bit of a perfect storm of difficult timing. My wife just gave birth, so I've been on parental leave. Working on this now, hopefully I'll have a release out this week, finally.

muuvmuuv commented 1 year ago

Congrats! No hurry, better leave that computer off and take your time. We wont retire because of that :D

asilliahmet commented 12 months ago

While this is getting fixed, you can either use

npm i @google/model-viewer --ignore-scripts or you can install an older version: npm i @google/model-viewer@3.1.1

This did not work for me, however installing a specific three version along with it did. What i did was: npm i @google/model-viewer@3.1.1 npm i three@0.151.2 Congrats to elalish in the meantime!