to dependencies, which would be a really useful way to test and demonstrate changes you have made to the package before making a pull request to the original author.
I think using git urls is not working at this point. I can add it to the package.json and the log says things were installed but the module fails to resolve.
Using the console and navigating to node_modules I can see that the git-based dependency is not there. If I manually run npm install the dependency seems to be downloaded correctly.
Edit: And adding a new dependency seems to cause the downloaded git repo to vanish, I have to manually run npm install again.
Edit 2: Changed my start command to "start": "npm install && node server.js" as a workaround
Preety much its the issue the node or npm version.
As I had some similar issue earlier, but when I downgraded my node version it happened to get fixed.
I hope that helps ya out.
@Froosty is right, there is a bug with the latest npm versions that makes npm prune not work correctly with git-based dependencies. After the install step, we always run an npm prune to free up some space.
We are working on a possible solution for the issue, we’ll keep you posted In the meantime, the workaround proposed by @Froosty should work!
It appeared to install correctly, but when I try to import the package, I get this error: Module not found: Error: Can't resolve 'rheostat' in '/app/src'.
I think I’m following the procedure correctly. The problem is that the Glitch platform does not seem to be installing them correctly. That’s the topic of this whole thread.
thanks for your report. However, in this particular case, the problem is not with the Glitch platform. If you try exactly the same code on your local machine, it won’t work either.
The reason is that when you use a GitHub dependency instead of a npm package, it might not always work: it depends on whether the repository has been properly configured. Typically, npm packages do not have the proper hooks to work when fetched directly from GitHub. In this case, for example, rheostat needs to be transpiled to be used as a node package. When you fetch it from npm, the maintainers of the package transpile it before uploading it to the npm registry, so it works as expected, but this is not the case when you fetch it directly from GitHub.
If you want to use the GitHub repository for your dependency, you have to manually modify its package.json to make sure the build step is run during the install phase. You also have to make sure all the necessary packages for compilation are installed (which means you’ve to move all the devDependencies to the dependencies field).
Let me know if you need further help
UPDATE: I am not a webpack expert, but you might also need to remove the node_modules exclude from your webpack.config.js file.
D’oh!! I should have known I was probably doing something wrong with the module import. Thanks so much @etamponi for debugging this for me and giving me a clear breakdown of the problem!