4 ms·
My primary development box is on Windows (for reasons similar to yours) and Node.JS is for better or worse, my bread & butter. The single biggest issue with No
by za_creature 10y ago
My primary development box is on Windows (for reasons similar to yours) and Node.JS is for better or worse, my bread & butter.
The single biggest issue with Node.JS (or Python, Ruby, Lua, PHP, etc) development on windows is in my book the difficulty of setting up the build tools so that you can compile native modules. It always takes me at least an hour, as instructions seem to stop working between major OS versions, MSVC versions and the versions of whatever language you're using (relevant example: you recently had to patch psycopg2 to get it to build in the VC compiler required by Python 3.5)
Path-wise, you won't encounter any trouble: Windows accepts / just as well as the preferred \ and the OS supports long file names; it's just the tooling that's bugged. npm3 mostly solves the issue, but if you're stuck with v2, `npm install -g rimraf` to get a long-path-aware version of `rm -rf` that you can use to "reset" your node_modules folder.
- nailer 10y ago> Windows accepts / just as well as the preferred \ So someone can (naively) concatenate paths with / and fs.readFile() and require() etc will still work? I'm on npm v3 right now anyway for the dedupe and better shrinkwrap features so no need for extra work.
- za_creature 10y agoB:\_purgatory>mkdir hello B:\_purgatory>echo "test" > hello/world B:\_purgatory>node > var fs = require("fs") undefined > fs.readFileSync("hello/world") <Buffer 22 74 65 73 74 22 20 0d 0a> As for require, iirc "/" is part of the spec and gets normalized to the OS standards afterwards
- chris_wot 10y agoOK, I just have to ask... what are you developing that it deserves the project title of "_pergatory"?!?
- za_creature 10y agoB: is my workspace partition, and `purgatory` is just the name of a folder I use for files and folders that I will eventually either delete or include in an existing project (helps when I'm in over my head with git). Underscore is there to show up first in explorer
- manyxcxi 10y agoTypically the problems we've had with pathing on Windows is when the module we're trying to use doesn't handle Windows paths as inputs, the other way around hardly (if ever) caused us a problem. I am pretty sure it even resolves something like /Program Files/My Program correctly to C:\Program Files\My Program. We just had a lot of modules barf when they got C:\Path\whatever and were trying to parse the path by hand or do other weird stuff like split on '/'.
- manyxcxi 10y agoThere was an article (maybe came across HN) not that long ago that details the history of MS-DOS and Windows, and they made note of how originally MS-DOS was going to use \ as a file separator, and instead of C:\ it would've just been C\, but due to some deal with IBM (I think) they wound up switching their path conventions. Because all the old code supported the more conventional pathing it was essentially just left in, and over time it's meant that Windows generally handles \ and / pretty well at the OS level.