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

[CI] Docsy NPM-package: global install fails as of 0.8.0 #2122

Open
2 of 3 tasks
chalin opened this issue Nov 12, 2024 · 1 comment
Open
2 of 3 tasks

[CI] Docsy NPM-package: global install fails as of 0.8.0 #2122

chalin opened this issue Nov 12, 2024 · 1 comment
Labels
CI/infra CI & infrastructure

Comments

@chalin
Copy link
Collaborator

chalin commented Nov 12, 2024

This was uncovered by @sftim through his work on

To reproduce the problem, run the following.

hugo new site --format yaml myproject
cd myproject
echo 'theme: docsy' >> hugo.yaml
echo 'themesDir: node_modules' >> hugo.yaml
npm init -y
npm install --save-dev autoprefixer postcss-cli hugo-extended@0.120.4

Finally:

$ npm install --save-dev --global google/docsy#semver:0.8.0
npm error code 1
npm error git dep preparation failed
npm error command /Users/chalin/.nvm/versions/node/v22.11.0/bin/node /Users/chalin/.nvm/versions/node/v22.11.0/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/Users/chalin/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm error npm warn using --force Recommended protections disabled.
npm error npm error code 1
npm error npm error path /Users/chalin/.npm/_cacache/tmp/git-cloneRDXfBp
npm error npm error command failed
npm error npm error command sh -c npm run _cp:bs-rfs
npm error npm error > docsy@0.8.0 _cp:bs-rfs
npm error npm error > cp -R node_modules/bootstrap/scss/vendor/* assets/_vendor/bootstrap/scss/
npm error npm error npm warn using --force Recommended protections disabled.
npm error npm error cp: node_modules/bootstrap/scss/vendor/*: No such file or directory
npm error npm error A complete log of this run can be found in: /Users/chalin/.npm/_logs/2024-11-12T12_22_20_271Z-debug-0.log
npm error A complete log of this run can be found in: /Users/chalin/.npm/_logs/2024-11-12T12_22_12_162Z-debug-0.log

Tasks

@chalin chalin added the CI/infra CI & infrastructure label Nov 12, 2024
@chalin
Copy link
Collaborator Author

chalin commented Nov 12, 2024

I also get failures for 0.11.0, but reported over to netlify-cli:

$ npm install --save-dev --global google/docsy#semver:0.11.0 2>&1 | head -50
npm warn tar TAR_ENTRY_ERROR ENOENT: no such file or directory, open '/Users/chalin/.nvm/versions/node/v22.11.0/lib/node_modules/docsy/node_modules/netlify-cli/node_modules/css-select/package.json'
npm warn tar TAR_ENTRY_ERROR ENOENT: no such file or directory, open '/Users/chalin/.nvm/versions/node/v22.11.0/lib/node_modules/docsy/node_modules/netlify-cli/node_modules/crossws/dist/adapters/cloudflare.mjs'
npm warn tar TAR_ENTRY_ERROR ENOENT: no such file or directory, open '/Users/chalin/.nvm/versions/node/v22.11.0/lib/node_modules/docsy/node_modules/netlify-cli/node_modules/css-tree/cjs/syntax/node/index-generate.cjs'
...

Moving netlify-cli into dev dependencies might help, as is suggested in:


This works:

$ npm install --global --omit=optional --ignore-scripts google/docsy#semver:0.11.0

Another idea is to package into a bash script (say, docsy/tools/install-npm-helper.sh) what is currently run via NPM script _mkdir:hugo-mod. That way we can run this helper script for projects using global installs as well. For example:

$ (cd /Users/chalin/.nvm/versions/node/v22.11.0/lib/node_modules && docsy/tools/install-npm-helper.sh)
PWD: /Users/chalin/.nvm/versions/node/v22.11.0/lib/node_modules
drwxr-xr-x  4 chalin  staff  128 Nov 12 12:49 github.com
$ npx hugo                                                                                            
Start building sites … 

@chalin chalin changed the title [CI] Docsy 0.8.0 NPM-package: global install fails [CI] Docsy NPM-package: global install fails as of 0.8.0 Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/infra CI & infrastructure
Projects
None yet
Development

No branches or pull requests

1 participant