brianblakely / nodep-date-input-polyfill

Automatically adds datepickers to input[type=date] on IE, macOS Safari, and legacy browsers.
https://www.npmjs.com/package/nodep-date-input-polyfill
MIT License
96 stars 137 forks source link

Unable to onboard a local build environment (npm dependencies outdated or broken) #72

Open daiplusplus opened 4 years ago

daiplusplus commented 4 years ago

Environment:

Steps taken:

  1. git clone https://github.com/brianblakely/nodep-date-input-polyfill.git
  2. cd nodep-date-input-polyfill
  3. npm install
    1. This errors-out because rollup-plugin-sass: "^0.5.3" depends on a specific sub-release release of node-sass (4.5.3 - win32-x64-72_binding.node ) that has been removed from their Github releases listings (so then npm downloads the Dart/C/C++ source-code for sass and tries to build it by itelf and it fails with a megabyte-sized error log... joy).
    2. I've seen some people say this is because this old version of node-sass is incompatible with NodeJS higher than version 10.0 - but that doesn't explain the HTTP 404 error and the fact the binding.node file is absent from GitHub.
    3. I was able to workaround this by manually installing a more recent version of rollup-plugin-sass.
  4. npm run build
    1. Fails because the more recent version of rollup-plugin-sass that I'm using doesn't support the rollup.config.js file included in the project. I get this error:
me@mine MINGW64 /c/git/clones/nodep-date-input-polyfill (master)
$ npm run build

> nodep-date-input-polyfill@5.2.0 build C:\git\clones\nodep-date-input-polyfill
> rollup -c

(!) Some options have been renamed
https://gist.github.com/Rich-Harris/d472c50732dab03efeb37472b08a3f32
entry is now input
format is now output.format
dest is now output.file

nodep-date-input-polyfill.js → nodep-date-input-polyfill.dist.js...
[!] Error: You must specify options.format, which can be one of 'amd', 'cjs', 'es', 'iife' or 'umd'
https://rollupjs.org/#format-f-output-format-
Error: You must specify options.format, which can be one of 'amd', 'cjs', 'es', 'iife' or 'umd'
    at error (C:\git\clones\nodep-date-input-polyfill\node_modules\rollup\dist\rollup.js:170:15)
    at checkOutputOptions (C:\git\clones\nodep-date-input-polyfill\node_modules\rollup\dist\rollup.js:18792:9)
    at generate (C:\git\clones\nodep-date-input-polyfill\node_modules\rollup\dist\rollup.js:18848:17)
    at Object.write (C:\git\clones\nodep-date-input-polyfill\node_modules\rollup\dist\rollup.js:18880:28)
    at C:\git\clones\nodep-date-input-polyfill\node_modules\rollup\bin\rollup:20989:27
    at next (C:\git\clones\nodep-date-input-polyfill\node_modules\rollup\bin\rollup:20946:32)
    at C:\git\clones\nodep-date-input-polyfill\node_modules\rollup\bin\rollup:20949:53

At this point I just gave up and I'll use a different <input type="date" /> polyfill. Sorry.

Update:

I found that I'm able to successfully npm install and npm run build this fork: https://github.com/mcshaz/nodep-date-input-polyfill

mcshaz commented 4 years ago

I think this is a dead project @Jehoel - because of this I have renamed the above fork to esm-date-input-polyfill - if you haven't synced upstream to my repo in a few days, it may be worth your while as there are a number more features which should mean it more closely simulates a native datepicker + is incredibly lightweight if the browser supports date inputs natively.

The release notes are at https://github.com/mcshaz/esm-date-input-polyfill/releases

have a look at https://mcshaz.github.io/esm-date-input-polyfill/ for a demonstration of the 2 ways to deploy and how the datepicker looks now.