SebastianS90 / webpack-polyfill-injector

Webpack plugin to automatically inject polyfills into your bundle without affecting modern browsers.
MIT License
82 stars 10 forks source link

npm install error after webpack-polyfill-injector was added to package.json #25

Closed rpokrovskij closed 5 years ago

rpokrovskij commented 5 years ago

When I add webpack-polyfill-injector to package.json

npm : npm WARN deprecated exists-sync@0.0.4: Please replace with usage of fs.existsSync
At line:1 char:1
+ npm install
+ ~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (npm WARN deprec...f fs.existsSync:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

npm

WARN

deprecated
 babel-preset-es2015@6.24.1: 🙌  Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update! 

> polyfill-library@3.27.0 postinstall D:\cot\EDelivery\EDelivery\EDelivery.Injected.AspCore.MvcApp\node_modules\polyfill-library
> npm run build

> polyfill-library@3.27.0 build D:\cot\EDelivery\EDelivery\EDelivery.Injected.AspCore.MvcApp\node_modules\polyfill-library
> npm run clean && node tasks/node/updatesources && node tasks/node/buildsources

> polyfill-library@3.27.0 clean D:\cot\EDelivery\EDelivery\EDelivery.Injected.AspCore.MvcApp\node_modules\polyfill-library
> rimraf ./polyfills/__dist

Updating third-party polyfills...
_TypedArray: No change
~html5-elements: No change
atob: No change
AudioContext: No change
EventSource: No change
fetch: Polyfill updated, replacing old version
  from ..\whatwg-fetch\fetch.js
 * Running module-specific update task update.task.js
HTMLPictureElement: No change
Intl: No change
JSON: No change
MutationObserver: No change
Promise: No change
UserTiming: No change
WebAnimations: No change
Polyfills updated successfully
Writing compiled polyfill sources to D:\cot\EDelivery\EDelivery\EDelivery.Injected.AspCore.MvcApp\node_modules\polyfill-library\polyfills\__dist/...
Waiting for files to be written to disk...
Sources built successfully
added 123 packages from 94 contributors and audited 9050 packages in 113.717s
found 0 vulnerabilities

package.json

"dependencies": {
    "@babel/polyfill": "7.2.5",
    "@dashboardcode/bsmultiselect": "0.2.19",
    "bootstrap": "4.2.1",
    "bootstrap-daterangepicker": "3.0.3",
    "datatables.net": "1.10.19",
    "datatables.net-bs4": "1.10.19",
    "jquery": "3.3.1",
    "jquery-validation": "1.19.0",
    "jquery-validation-unobtrusive": "3.2.11",
    "popper.js": "1.14.6",
    "source-map": "^0.7.3"
  },
  "devDependencies": {
    "@babel/cli": "7.2.3",
    "@babel/core": "7.2.2",
    "@babel/node": "7.2.2",
    "@babel/plugin-external-helpers": "7.2.0",
    "@babel/plugin-transform-modules-umd": "7.2.0",
    "@babel/plugin-transform-spread": "7.2.2",
    "@babel/preset-env": "7.2.3",
    "@babel/preset-typescript": "7.1.0",
    "@types/bootstrap": "^4.2.0",
    "@types/jquery": "3.3.29",
    "@types/node": "10.12.18",
    "@types/webpack-env": "1.13.6",
    "autoprefixer": "9.4.5",
    "babel-loader": "8.0.5",
    "babel-plugin-transform-class-properties": "6.24.1",
    "babel-plugin-transform-remove-import": "1.0.0",
    "bundlesize": "^0.17.0",
    "clean-webpack-plugin": "1.0.0",
    "cross-env": "^5.2.0",
    "css-loader": "2.1.0",
    "del": "^3.0.0",
    "expose-loader": "0.7.5",
    "file-loader": "3.0.1",
    "gulp": "^4.0.0",
    "html-loader": "0.5.5",
    "html-webpack-plugin": "3.2.0",
    "import-loader": "1.0.1",
    "material-design-icons": "3.0.1",
    "mini-css-extract-plugin": "0.5.0",
    "node-sass": "4.11.0",
    "npm-run-all": "4.1.5",
    "optimize-css-assets-webpack-plugin": "5.0.1",
    "postcss-cli": "6.1.1",
    "postcss-loader": "3.0.0",
    "precss": "4.0.0",
    "resolve-url-loader": "3.0.0",
    "sass": "^1.16.0",
    "sass-loader": "7.1.0",
    "script-loader": "0.7.2",
    "source-map-explorer": "1.6.0",
    "source-map-loader": "0.2.4",
    "style-loader": "0.23.1",
    "typescript": "3.2.2",
    "uglifyjs-webpack-plugin": "2.1.1",
    "url-loader": "1.1.2",
    "webpack": "4.28.4",
    "webpack-bundle-analyzer": "3.0.3",
    "webpack-cli": "3.2.1",
    "webpack-manifest-plugin": "2.0.4",
    "webpack-merge": "4.2.1",
    "webpack-polyfill-injector": "3.0.1"
  },
SebastianS90 commented 5 years ago

Is it really an error or a warning only?

And please try to install polyfill-library instead of webpack-polyfill-injector (just to see where the problem comes from). If the error/warning persists, then the issue is somewhere upstream and should be reported there. Otherwise please let me know, then I'll have a look into this.

rpokrovskij commented 5 years ago

You are right, it was warning.

After many "magic steps" (migrate node to 10, npm to latest, npm init) install start working (DOM polyfills works also).

So it is solved.

Still would like to have even an assumption how babel-preset-es2015@6.24.1 could be a problem if it was not referenced in my package.json ... Mystic.

SebastianS90 commented 5 years ago

Probably some transitive dependency with outdated version. My package depends on polyfill-library which has a lot of dependencies.