-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[BUG] Adding modules from GitHub not working #7898
Comments
@cmahnke Could you provide detailed, step by step instruction on how to reproduce the issue?, This should include all the commands run, starting from an empty directory, and any prerequisites steps you took before running the npm install. |
Afterwards:
Sources are missing Context:
|
I have tried with the steps provided and i am unable to repro the issue as mentioned. Its erroring out. Appreciate if you provide more detailed steps on how to repro the issue. |
@kchindam-infy: Thanks! That actually a good hint, might it be the case that it's failing silently (or just by setting a return code)? If yes, that should be considered a bug in itself of cause. But I'll have a deeper look on my side first: UpdateWhile creating a demonstration I could reproduce your findings, they are related to Automattic/node-canvas#2448 |
@kchindam-infy |
@cmahnke I have reviewed the package.json of ProjectMirador "files": [
That's why you're only seeing minimal files in node_modules/mirador/. |
@kchindam-infy Thanks for the clarification, so basically it's an error that this works in yarn? I'm afraid there is no workaround? |
As an workaround, you can manually trigger the build process of mirador after installing it with npm by adding it as a dependency in your package.json and including a postinstall script. Specifically, add "mirador": "github:ProjectMirador/mirador#5cb692ed" to your "dependencies" and include a "postinstall" script like "postinstall": "cd node_modules/mirador && npm install && npm run build". This script will navigate into the mirador directory after installation, install its own dependencies, and run the build command to generate the necessary files. By doing this, when you run npm install, it will install mirador from GitHub and automatically build it, ensuring all required files are present in node_modules/mirador/. This workaround allows you to continue using npm without switching to yarn. |
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
When installing a depedency from Github with a given commit / revision hash, the required code should be installed to
node_modules
.Example:
Only packages.json and text files (LICENSE, README.md) are installed.
According to the documentation this is a valid notation, but others aren't working either...
Using Yarn this works and demonstrates that this is a serious bug:
Expected Behavior
npm
should download and install the required dependency not just metadata, just asyarn
doesSteps To Reproduce
mkdir test
cd test
npm i --verbose github:ProjectMirador/mirador#5cb692ed
ls node_modules/mirador/
Sources are missing
Environment
The text was updated successfully, but these errors were encountered: