Model-viewer: Cannot install package from NPM on Windows

Created on 9 Oct 2019  路  7Comments  路  Source: google/model-viewer

Description

Please provide a detailed description of the bug, how to reproduce it, and the
expected behavior. Always include a code snippet, screenshot, any errors
reported in the console, and the model to help us understand and fix the
problem.

the version doesnt install npm dependencies : Error
on windows 10

Versions

  • model-viewer: v0.6.2

2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prefetch-samples', 'fetch-samples', 'postfetch-samples' ]
5 info lifecycle @google/[email protected]~prefetch-samples: @google/[email protected]
6 info lifecycle @google/[email protected]~fetch-samples: @google/[email protected]
7 verbose lifecycle @google/[email protected]~fetch-samples: unsafe-perm in lifecycle true
8 verbose lifecycle @google/[email protected]~fetch-samples:
9 verbose lifecycle @google/[email protected]~fetch-samples: CWD: C:\xampp\htdocs\modelviewer
10 silly lifecycle @google/[email protected]~fetch-samples: Args: [ '/d /s /c', './scripts/fetch-khronos-gltf-samples.sh' ]
11 silly lifecycle @google/[email protected]~fetch-samples: Returned: code: 1 signal: null
12 info lifecycle @google/[email protected]~fetch-samples: Failed to exec fetch-samples script
13 verbose stack Error: @google/[email protected] fetch-samples: ./scripts/fetch-khronos-gltf-samples.sh
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycleindex.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:203:13)
13 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:203:13)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid @google/[email protected]
15 verbose cwd C:\xampp\htdocs\modelviewer
16 verbose Windows_NT 10.0.16299
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "fetch-samples"
18 verbose node v12.6.0
19 verbose npm v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error @google/[email protected] fetch-samples: ./scripts/fetch-khronos-gltf-samples.sh
22 error Exit status 1
23 error Failed at the @google/[email protected] fetch-samples script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

community compatibility tooling help wanted bug

All 7 comments

@PerspectivesLab thanks for reporting! I'm sorry to say that we don't currently develop on Windows machines so we have a blind spot in this regard, and it is difficult for us to diagnose the issues on our own. Another user reported a similar issue a little while back, and I responded here: https://github.com/GoogleWebComponents/model-viewer/issues/732#issuecomment-526377475

If you or anyone else would be willing to help us with a patch to improve Windows support, we would be grateful 馃檱

Hi @cdata ok ill try to fix that tomorow, thx !

I was able to run the script on a second try on windows by setting an absolute path for fetch-samples:..
"update-screenshots": "node ./scripts/update-screenshots.js ./test/fidelity/config.json",
"fetch-samples": "e:/github/website/model-viewer/scripts/fetch-khronos-gltf-samples.sh",
"serve": "ws",
then npm install worked all the way through, with some report about npm audit, which I ignored.

after that, i ran

npm run build
and
npm run serve
and it is serving the samples correctly.

I assume some problem in npm in windows interpreting ./ directive
I ran my command prompt as administrator, probably don't need to.
suggest edit that one line in package.json for path to fetch-samples and try again.

maybe the docs could mention that windows is not supported much?

Thanks for diagnosing that @mister-elliott , I'm glad it was pretty straight forward.

And yah, we should mention that we don't have the ability to verify Windows compatibility for dev purposes.

I gitted everything to a ubuntu install on a dual boot laptop, then ran the npm commands, and everything works fine.

Hi,I get following error if i try to do 'npm i' in windows. Npm i was actually working fine before. Suddenly it stopped working, I am not able to understand the reason. Any help will be appreciated. Thanks in advance.

This is wen i do npm i through cmd-
'CALL "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" prefix -g' is not recognized as an internal or external command,
operable program or batch file.

Also through vs code terminal it throws-
Program 'npm.cmd' failed to run: Access is deniedAt line:1 char:1

  • npm i
  • ~.
    At line:1 char:1
  • npm i
  • ~

    • CategoryInfo : ResourceUnavailable: (:) [], ApplicationFailedException

    • FullyQualifiedErrorId : NativeCommandFailed

Was this page helpful?
0 / 5 - 0 ratings