News for hackers. Stuff that matters.
Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by dikaiosune on Tuesday October 31, 2017 @03:46PM (#15595955)
I'm definitely curious to see if the update to npm 5.5.1 resolves most of the issues people have seen on the 5.x releases. Otherwise having an LTS release with a rough release of npm might be pretty painful for a lot of the ecosystem.
Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by mindcrash on Tuesday October 31, 2017 @04:07PM (#15596114)
Yarn [0] might be a great alternative for those who have been bitten in the proverbial ass by npm a bit too many times.

[0] https://yarnpkg.com/lang/en/

Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by dikaiosune on Tuesday October 31, 2017 @04:18PM (#15596200)
I've recommended yarn for projects of mine that were broken by npm5, but it has some of its own issues. It's also not bundled by default which is really important for JavaScript tools that are used by beginners.
Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by TAForObvReasons on Tuesday October 31, 2017 @04:39PM (#15596337)
Our deployment setups explicitly roll back to npm 4. every version of npm5 has had problems with some step (currently fighting issues with react-native), including the latest 5.5.1 :(
Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by alvis on Wednesday November 01, 2017 @01:21AM (#15598951)
Another option is pnpm(https://pnpm.js.org), a lesser known but much faster alternative.
Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by saas_co_de on Tuesday October 31, 2017 @04:05PM (#15596091)
yarn has resolved most of the issues already :)
Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by abritinthebay on Tuesday October 31, 2017 @04:08PM (#15596127)
In my experience that’s simply not true.

We’ve seen more issues with Yarn in CI & prod than with npm 5.x

Both are great projects but npm is significantly more mature.

Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by saas_co_de on Tuesday October 31, 2017 @04:49PM (#15596414)
I guess it just depends on what you are doing. With npm 5.x installed packages started disappearing at random for me. Switched to yarn and no problems since.
Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by abritinthebay on Tuesday October 31, 2017 @06:20PM (#15597100)
I have never seen that (or even heard of it). How bizarre.
Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by nfriedly on Wednesday November 01, 2017 @07:20AM (#15600225)
I've had it happen to me before. It's weird and annoying, and you basically have to nuke node_modules and sometimes package-lock.json, and then re-install everything to fix. That usually works.
Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by nailer on Tuesday October 31, 2017 @06:45PM (#15597304)
Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by mtphil on Tuesday October 31, 2017 @04:48PM (#15596406)
Just out of curiosity, having never encountered any issues myself - what sort of issues have you run into with Yarn in CI/prod ?
Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by abritinthebay on Tuesday October 31, 2017 @06:22PM (#15597110)
Reliability, mostly. Also some strange cases where it would just plain fail (but then work if re-run).

We do use private scoped packages a lot so that might have some bearing on it.

Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by nailer on Tuesday October 31, 2017 @06:45PM (#15597302)
I use private scoped packages (and monorepos, and yarn) too, and have generally had a fine time with it.

Would be interested in specifics of your reliability and failure problems too.

Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by qudat on Wednesday November 01, 2017 @01:09AM (#15598909)
We just started using yarn workspaces and are running into weird issues where our private scoped packages don't always get installed on `yarn install`.

Yarn claims to be deterministic but I still need to `rm -rf node_modules` regularly when I run into weird build errors. It's quite strange.

Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by abritinthebay on Wednesday November 01, 2017 @04:08AM (#15599522)
Well... I don’t use it anymore because frankly, there’s no need.
Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by jsight on Tuesday October 31, 2017 @10:13PM (#15598414)
Is there any chance that you are using npm to install yarn?

I had mistakenly setup our CI to do that at one point and it caused a lot of hard to debug problems.

Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by abritinthebay on Thursday November 02, 2017 @01:18PM (#15612305)
I was not, but even if I was that speaks to Yarn’s quality imo because they recommend that as an option.
Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by jhgaylor on Tuesday October 31, 2017 @04:25PM (#15596248)
We finally got NPM out of the loop for production deploys and it's been glorious. We ship down a tarball of the repo after an npm install and include a node interpreter.
Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by abritinthebay on Tuesday October 31, 2017 @06:20PM (#15597091)
Ah well, that’s a whole different kind of system. Similar to doing a docker image ship.

Still have to do the install on a deploy server.

Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by tuananh on Wednesday November 01, 2017 @01:41AM (#15599025)
seems like a perfect use case for Docker.
Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by jhgaylor on Wednesday November 01, 2017 @10:57AM (#15601688)
I whole heartedly agree. Would you tell that to my boss? :D
Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by rawrmaan on Tuesday October 31, 2017 @04:20PM (#15596211)
Agreed. I tried to switch to yarn a couple times now and it simply wasn't reliable (though the last attempt was a few months ago)
Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by npolet on Tuesday October 31, 2017 @07:05PM (#15597430)
Yea I'm big fan of it. Strange things used to happen with npm, dependencies would break, installs would fail etc... Maybe something to do with our build config, but since moving to yarn, no problems. We don't ever think about packages breaking or anything now (which is how it should be).
Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by abritinthebay on Tuesday October 31, 2017 @04:05PM (#15596088)
I’ve seen zero issue with npm locally or in production (have more issues with Webpack tbh)

What kind of problems?

Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by 0x0 on Tuesday October 31, 2017 @06:29PM (#15597180)
I've had major trouble with the fact that the new package-lock.json doesn't sufficiently lock versions. In one working copy you can run "nom install" and everything works with no files or package-lock being changed. Yet, in another clean checkout, "npm install" brings in a different set of dependency versions despite having a -lock file, and things start to break. Yarn's yarn.lock seems to get this right.
Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by tuananh on Tuesday October 31, 2017 @10:31PM (#15598462)
any chance that you did `npm install --production` maybe? i think the lock file might be different for that case.
Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by dikaiosune on Tuesday October 31, 2017 @04:17PM (#15596190)
Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by vacri on Tuesday October 31, 2017 @04:40PM (#15596349)
How are we nearly a decade into the life of NodeJS and still suffering from problems with its package manager, which itself is up to version 5.x?
Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by TheCoreh on Tuesday October 31, 2017 @04:53PM (#15596453)
Because npm 5 was a pretty big update that fundamentally changed how a lot of npm portions work, in order to close the gap between it and Yarn, a competing package manager. The 5.0 release was super rushed IMO (I personally hit several bugs), but if you stuck to node LTS you skipped over most of the v5 breakage (now it works 99.99% of the time again, and when it doesn't work deleting node_modules usually does the trick)
Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by nailer on Tuesday October 31, 2017 @05:33PM (#15596791)
npm v5 is still deleting private packages - the issue has been open, accepted and replicable since npm v5 was released - see https://github.com/npm/npm/issues/17929 nad various related issued linked from that page. This sucks if you use a monorepo.

yarn workspaces works a treat though.

Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by pcsanwald on Tuesday October 31, 2017 @06:01PM (#15596972)
package management is a harder problem than most people seem to want to admit. I've run into tons of issues with every package management system you can think of: rpm does some extremely dodgy caching stuff at times, navigating maven dependency trees to identify the offending version of slf4j that is harshing the vibe, etc.

I can't think of a single package management system that works well and people seem to love.

Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by ojanik on Wednesday November 01, 2017 @08:44AM (#15600602)
Nuget. Can't remember last time i had issues.
Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by nfriedly on Wednesday November 01, 2017 @07:22AM (#15600235)
Cargo?
Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by jdavis703 on Tuesday October 31, 2017 @06:46PM (#15597308)
> which itself is up to version 5.x

Major version numbers in Javascript are defined using SEMVER. What this means is that a major version only implies that a breaking change was included (e.g. the API contract is different). It doesn't really have anything to do with a classic pattern where V2 is seen as the second phase, and V5 is seen as the fifth phase, etc, of a project.

Re:Node.js 8 Moves into Long-Term Support, Node.js 9 Becomes... by rejschaap on Wednesday November 01, 2017 @02:32AM (#15599190)
A breaking change should not be made lighthearted. It can cause a lot of inconvenience for your userbase.