How do I fix this?
npm -v
6.5.0
node -v
7.5.0
npm install
npm WARN [email protected] requires a peer of webpack@^3.1.0 but none is installed. You must install peer dependencies yourself.
npm install --save webpack@^3.1.0
npm WARN [email protected] requires a peer of webpack@1 || 2 || ^2.1.0-beta || ^2.2.0-rc but none is installed. You must install peer dependencies yourself.
npm install --save webpack@^2.2.0-rc
npm WARN [email protected] requires a peer of webpack@^3.1.0 but none is installed. You must install peer dependencies yourself.
Notice that laravel-mix requires node6 or later:
package.json
"engines": {
"node": ">=6.0.0"
}
I had mistyped node as 5.7.0, it should have been 7.5.0
Also my package.json did not have engines included. Unfortunately adding it in did not help.
Can you give us the version of laravel mix?
"laravel-mix": "^1.7.2"
Please post your package.json. I tried to reproduce the problem like that (with node 8.9.4):
npm init -y
npm install laravel-mix --save-dev
npm install [email protected] --save-dev
No problems on my system.
It happened just as I added vuex, although I have had a similar problem before
{
"private": true,
"scripts": {
"dev": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch-poll": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --watch-poll --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"hot": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"production": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"@ryancavanaugh/jqrangeslider": "^4.2.14-alpha",
"axios": "^0.15.3",
"babel-core": "^6.26.0",
"babel-loader": "^6.4.1",
"bootstrap-sass": "^3.3.7",
"droply": "0.0.3",
"gulp": "^3.9.1",
"ioredis": "^2.5.0",
"jquery": "^3.1.0",
"leaflet.markercluster": "^1.0.5",
"lodash": "^4.16.2",
"vue": "^2.1.10",
"vue-router": "^2.3.0",
"vue-template-compiler": "^2.4.4",
"vue-upload-component": "^0.3.9",
"webpack": "^3.1.0"
},
"dependencies": {
"@turf/turf": "^3.14.3",
"animate.css": "^3.5.2",
"bulma": "^0.6.0",
"chart.js": "^2.5.0",
"express": "^4.15.2",
"extract-text-webpack-plugin": "^3.0.2",
"laravel-mix": "^1.7.2",
"leaflet": "^1.0.3",
"socket.io": "^1.7.3",
"sweetalert2": "^6.6.2",
"turf-featurecollection": "^1.0.1",
"vee-validate": "^2.0.0-rc.7",
"vue-bulma-progress-bar": "^1.0.2",
"vue-chartjs": "^2.3.7",
"vue-leaflet": "^0.1.0",
"vue-slider-component": "^2.2.3",
"vue-socket.io": "^2.1.0",
"vuex": "^3.0.1",
"web3": "^0.18.4"
}
}
weird dependencies:
"devDependencies": {
"": "^4.2.14-alpha",
…
"dependencies": {
"": "^3.14.3",
…
Yeah, I actually just got rid of that first one.
Here's the outcome on linux with npm 8.9.4 and your package.json:
$ npm install
npm WARN deprecated [email protected]: The version is outdated
npm WARN deprecated [email protected]: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated @turf/[email protected]: Module has been renamed to @turf/bezier-spline
npm WARN deprecated @turf/[email protected]: Module has been renamed to @turf/boolean-point-in-polygon
npm WARN deprecated @turf/[email protected]: Module deprecated in favor of @turf/length
npm WARN deprecated @turf/[email protected]: module will be replaced with @turf/interpolate
npm WARN deprecated @turf/[email protected]: Module has been renamed to @turf/nearest-point
npm WARN deprecated @turf/[email protected]: Module has been renamed to @turf/nearest-point-on-line
npm WARN deprecated @turf/[email protected]: Module has been renamed to @turf/point-on-feature
npm WARN deprecated @turf/[email protected]: Module has been renamed to @turf/points-within-polygon
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated @turf/[email protected]: Module has been renamed to @turf/points-within-polygon
npm WARN deprecated @turf/[email protected]: Module has been renamed to @turf/boolean-point-in-polygon
npm WARN [email protected] requires a peer of webpack@1 || 2 || ^2.1.0-beta || ^2.2.0-rc but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of leaflet@~1.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
added 279 packages and updated 1 package in 48.082s
While there are warnings, it installs fine on my system
Oh:) Just noticed, there we go: peer of webpack required.
Notice that the warning is in my case related to babel-loader. So what I did was:
$ npm install babel-loader@^7.1.1 --save-dev
npm WARN [email protected] requires a peer of leaflet@~1.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
+ [email protected]
removed 5 packages and updated 1 package in 8.119s
$ # Just a check
$ npm install
npm WARN [email protected] requires a peer of leaflet@~1.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
up to date in 7.481s
That worked for me too, but now I have 2 instances of babel loader, one in dependencies and another in devDependencies.
npm run dev still doesn't work 8-)
$ npm run dev
"scripts": {
"dev": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch-poll": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --watch-poll --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"hot": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"production": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
> node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
module.js:472
throw err;
^
Error: Cannot find module '/Users/Sean/Code/olmbulma/node_modules/cross-env/dist/bin/cross-env.js'
This worked for me
npm install --save-dev cross-env
$ npm run dev // works fine now
Thank you for your help!!
I think you should clean up your package.json before you proceed.
Here's a recent package.json of mine. It doesn't match your needs, it's only to give you clues about what should go where and what is probably not needed.
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"lint": "node_modules/.bin/eslint --fix resources/assets/js",
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"babel-eslint": "^8.1.2",
"bootstrap-sass": "^3.3.7",
"cross-env": "^5.0.1",
"eslint": "^4.14.0",
"eslint-config-airbnb": "^16.1.0",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.5.1",
"eslint-plugin-vue": "^4.0.0-beta.4",
"jquery": "^3.1.1",
"laravel-mix": "^1.7.2",
"lodash": "^4.17.4",
"vue-template-compiler": "^2.5.9"
},
"dependencies": {
"axios": "^0.17.1",
"core-js": "^2.5.3",
"dialog-polyfill": "^0.4.9",
"vue": "^2.5.9",
"vue-i18n": "^7.3.2",
"vue-router": "^3.0.1"
}
}
Next time just delete your node_modules folder and package-lock.json or if you're using yarn yarn.lock file then try again. Most of the time it should work as it will pull in the relevant updated packages.
@tpraxl how you fixed this error :
npm WARN [email protected] requires a peer of leaflet@~1.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
up to date in 51.025s
i m stucked on it
Solution:
npm install laravel-mix@beta
@SharakPL made the comment at the end.
npm install laravel-mix@beta
Should fix it.
Most helpful comment
Next time just delete your
node_modulesfolder andpackage-lock.jsonor if you're using yarnyarn.lockfile then try again. Most of the time it should work as it will pull in the relevant updated packages.