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

"Packaging" breaks the expected behavior of 'npm install <folder>' #468

Closed
thoughtsunificator opened this issue Dec 8, 2024 · 2 comments

Comments

@thoughtsunificator
Copy link

thoughtsunificator commented Dec 8, 2024

Environment

  • OS Version: Linux
  • Node.js Version: v23.1.0

Actual behavior

Error: Cannot find module '/tmp/fast-glob-test/node_modules/fast-glob/build/index.js'

Expected behavior

The module should load as expected.

Steps to reproduce

  • Clone fast-glob repo
  • Inside a directory, test, init a new npm package (npm init -y)
  • npm install ../fast-glob
  • node -e "const fg = require('fast-glob');"

Code sample

const fg = require('fast-glob');
@mrmlnc
Copy link
Owner

mrmlnc commented Jan 2, 2025

The npm install command only installs dependencies. The package is written in TypeScript and requires compilation. If you clone a repository rather than installing a package from the npm registry, you need to understand its internal arrangements (assembly, bundling, etc.).

The set of commands should be as follows:

npm i
npm run build
npm run bundle

@mrmlnc mrmlnc closed this as completed Jan 2, 2025
@thoughtsunificator
Copy link
Author

Except there is no bundling or assembling phase specified by the package manager, being npm in this case. npm install is expected to work as is.

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