Should Bower be Updating a Package Every Time Repeatedly? - angularjs

Not much to the question really - I have an error when trying to build with gulp (first highlight). I noticed when I run "bower update bootswatch," it downloads something every time. I have very little experience with package management, so I was wondering if this is a problem, and if it is, what I can do about it.
Edit: An important note is that it doesn't reinstall/re-download any of the other tens of packages.
Edit 2: On the end of the big rectangle there is a covered-up part: "invalid-meta bootswatch is missing "main" entry in bower.json" - is this important?

Just based on the history of bower questions on here, I am guessing no one has any clue as to what's going on, understandably - neither do I. With that said, I am posting a lazy "solution": After verifying versions and such are exactly the same with a co-worker, but the file content is different, my coworker sent me his bootswatch folder and I copied it into bower components. That fixed it.

Related

webpack, webpack-obfuscator and webpack-cli version hell

This must be one of the most tiresome conundrums a web developer can delve into.
I can ask a straigthtforward question right here however:
Which versions of the three mentioned.
(webpack, webpack-obfuscator and (possibly )webpack-cli)
ensure that it all works together?
if you know, you can stop reading here,
and (please) give an answer, or you can read on:
I have a Yii2 php app, with npm/javascript/React frontend support. I do:
composer install,
npm install,
npm run build.
When this is done from scratch (fresh clone from Github, caches cleared), it almost always ends up with npm run build giving this:
Error: The number of constructor arguments in the
derived class t must be >= than the number of
constructor arguments of its base class."
NOTE: I am completely happy just to have this issue fixed, so it all builds. Not sure of the webpack-cli part coming up (if you read on).
And NOTE again: This problem occurs in Windows 10, when I try to build a local version. All works well in Linux (Ubuntu 18.04).
We now have in package.json:
"webpack": "^2.4.1",
"webpack-obfuscator": "^0.17.3"
I then try higher versions of webpack-obfuscator until this error ceases, but instead there is another error (!):
TypeError: Cannot read property 'emit' of undefined
So, then I figure: maybe we can test higher versions of webpack as well?
I do that, but then comes another error:
Error: Cannot find module 'webpack-cli'...
(So again, I am not sure it's something I need, I belive I answered yes to some yes/no question coming up)
There are zillions of versions, and I am now sick & tired of it. This problem has haunted me the last years.
Now this day I decided to go to the bottom with it once and for all. I have spent 6 hours, and I failed.
So very thankful for an answer, somebody must have experience from this...

React: Find modules, not used

I came into a team that had already started a React team. The installation takes 30 minute into the cloud because of all the dependencies in node_module. When I look in this folder, there are 1084 folders. I'm pretty sure there are a lot of stuff here that is never touched, but may also be in the package.json. In attempted to clean up and speed up the installation process, is there any automated way to find out if our project actually needs it, without removing one item at a time?
1) https://github.com/depcheck/depcheck to clean you package.json
2) delete node_modules and reinstall everything

Electron Forge, React, etc. build has gone mad

I'm completely asea here.
We had a working app build with an old Electron Forge (^5.2.4; 5.2.6) created using the old React template (1.0.2-1.0.4) with the usual suspects of React tech (react-redux, react-router, etc.)
Up until about 1-2 weeks ago everything has been fine. Now, after running its startup code, showing some components, doing some things, then we get a Variant 119 error (ref issues or multiple versions of React).
Since the code used to work the ref thing seems spurious, but I checked all our refs (there are a total of two). I did the usual npm ls and yarn list, even checked a lot of modules for additional Reacts, but found nada.
Our yarn.lock file has not changed other than some internal dependencies that aren't Electron or React related. No external components (BlueprintJS, Semantic UI React, ...) have changed over the course of working-to-non-working.
Here's the kicker: reverting to previously-working versions (including deleting node_modules etc.) doesn't help. The build machine is running the same version of NodeJS as it has been (10.15.mumble). I've tried to track down caches (including Yarn) and deleted them, deleted the out directory, done full rebuilds, etc.
What could be impacting an Electron Forge build like this? What other code, directories, caches, configurations, etc. should I be looking for?
That it impacts previously-working versions points me towards build/environment problems, although this happens across machines, which points back at the project. After multiple days bisecting and rebuilding and having the same thing happen I've paid a visit to Witt's End. And I don't like it there.
Looking at the error message, it lists two different reasons for the error. It seems you have ruled out multiple react instances in your code, but be wary if you use npm link as that can do weird things with dependencies.
So have you check to see if someone on your project team checked in something that is trying to use a ref where they shouldn’t as that will also cause this error

Imported linked libraries resets back when rebuilt - how to avoid for specific libraries?

I'm trying to make modifications to some of the imported libraries that I added using yarn. When I make a change to those libraries under node_modules, and then run react-native run-android, modifications are updated then. But when I run react-native run-android the next time, it gets reset back to the original.
I wanna make changes to it and save it with my custom modifications. How do I avoid it getting reset back to the original library? This question might sound really basic and stupid, but I have no idea how to and I can't find any solution to this when I tried to search a solution for this.
node_modules must not be changed manually as it is assumed to be read-only dependency.
If you still want to change one of node_modules , you have three ways :
Create a pull-request which contains your changes to the repository of this module and follow up with the owner of repository until merge the pull-request and publish your changes in npmjs.com.
Definitely, this solution can take much time which breaks your productivity . If so , the best solution is :
Fork the repository of the module , make changes and if the license allows you , publish your repo under https://npmjs.com using
cd /path/to/your-repo-after-changes;
npm publish;
Then go back to your project and run :
yarn add your-repo-after-changes ;
According to license, you may copy/paste the module source code that you want to change to your project under a folder (external-modules for example) , make your changes and export from external-modules .

Grunt and Bower config issue

I am fighting a weird problem that has caused me to pull my hair out multiple times. For a project we are working on we are using bower and grunt to deal with dependencies etc... everything seems to be fine except our angular app is looking for all the stuff to be put in the bower_dep folder. It does this on every one elses machine ... on my machine however when bower goes out and gets dependencies it puts them in app/bower_dep and my app doesnt find them ... on top of that of course if i forget to manually copy the stuff over the app winds up breaking in spectacular fashion.
The question here becomes why would grunt/bower be putting my dependencies in app/bower_dep rather than /bower_dep like it does on everyone elses machine?

Resources