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

Unable to npm install on Windows OS #491

Open
Bebul opened this issue Jan 5, 2024 · 7 comments
Open

Unable to npm install on Windows OS #491

Bebul opened this issue Jan 5, 2024 · 7 comments

Comments

@Bebul
Copy link
Contributor

Bebul commented Jan 5, 2024

It is a fresh problem.
After 1d51383 the npm install ends with errors, while when checkouting the previous commit 8682404 it works without any error.

The C:\WINDOWS\system32\cmd.exe /d /s /c $npm_execpath run compile cannot work on Windows OS, as there should be %npm_execpath% or something, and also this environment variable set. Maybe the package.json contains more than necessary?

npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js install --force --cache=C:\Users\bebul\AppData\Local\npm-cache --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-au
dit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! > chessground@8.2.0 prepare
npm ERR! > $npm_execpath run compile
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm WARN deprecated rollup-plugin-terser@7.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
npm ERR! '$npm_execpath' is not recognized as an internal or external command,
npm ERR! operable program or batch file.
npm ERR! npm ERR! code 1
npm ERR! npm ERR! path C:\Users\bebul\AppData\Local\npm-cache\_cacache\tmp\git-cloneEa9WIH
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c $npm_execpath run compile
@Bebul
Copy link
Contributor Author

Bebul commented Jan 5, 2024

Sorry.
It looks it does not work on the 8682404 either.
npm install does not end with errors, but it does not install modules/pgn-viewer/package.json. When I try to install it the same errors happen.

@Bebul
Copy link
Contributor Author

Bebul commented Jan 5, 2024

So I am trying to experiment over the fresh 1d51383 state...
When I remove the dependance line:

    "chessground": "mliebelt/Chessground",

The npm install works, but the build fails for

Module not found: Error: Can't resolve 'chessground' in 'D:\dev\PgnViewerJS-original\src'

@Bebul
Copy link
Contributor Author

Bebul commented Jan 5, 2024

So, it looks like mliebelt/chessboard relevant issue, which is only fork of the original lichess chessboard.
I have tried to run yarn install here and it fails with the exactly the same reason:

'$npm_execpath' is not recognized as an internal or external command

When I replace the environment variable with

"prepare": "npm run compile", // instead of "prepare": "$npm_execpath run compile",

I am able to run yarn install and process demo.html.

@Bebul
Copy link
Contributor Author

Bebul commented Jan 5, 2024

I think, there are two possible ways to overcome this issue:

  1. avoid using github repository as a library and deploy it into some @mliebelt/chessboard and use this one.
  2. or try to make mliebelt/Chessboard cross platform
    • I have already tried to do it on the clone of your repository and I was able to build the chessboard
    • I will try to use it in the PgnViewerJS and if it works, I will try to pose a Pull Request

@Bebul
Copy link
Contributor Author

Bebul commented Jan 5, 2024

And here you are mliebelt/chessground#1

(I think, if the PR will be accepted (please, try it) then this issue can be closed.)

@mliebelt
Copy link
Owner

mliebelt commented Jan 6, 2024

Ok, I have merged your pull request. I tried some months ago to upgrade Chessground to the newest version, but failed, and did not find out the reason for that. Perhaps I will try that again, to get rid of the necessity to build Chessground on my own. For the moment, you should be able to build pgn-viewer again.

@Bebul
Copy link
Contributor Author

Bebul commented Jan 6, 2024

Perhaps I will try that again, to get rid of the necessity to build Chessground on my own.

It was first thing I tried too. Also failed.
I will try again.

For the moment, you should be able to build pgn-viewer again.

I was able to do so using my own build, forking yours, so I expect it really should work now.

Thank you 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants