question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dependencies not found error references my own files

See original GitHub issue
  • Laravel Mix Version: +-- laravel-mix@1.1.1
  • Node Version: v8.1.3
  • NPM Version: 5.2.0
  • OS: Windows 10

npm list --depth=0 does give me an error though (even when manually installing webpack):

`-- webpack@2.2.0

npm ERR! peer dep missing: webpack@^2.2.0, required by extract-text-webpack-plugin@2.1.2

Complete list:

+-- axios@0.15.3
+-- bootstrap-sass@3.3.7
+-- cropperjs@1.0.0-rc.3
+-- cross-env@5.0.1
+-- flatpickr@2.6.3
+-- jquery@3.2.1
+-- jquery-mousewheel@3.1.13
+-- laravel-mix@1.1.1
+-- lodash@4.17.4
+-- malihu-custom-scrollbar-plugin@3.1.5
+-- nouislider@9.2.0
+-- owl.carousel@2.2.0
+-- tinymce@4.6.4
+-- vue@2.3.4
`-- webpack@2.2.0

npm ERR! peer dep missing: webpack@^2.2.0, required by extract-text-webpack-plugin@2.1.2

Description:

Since updating laravel-mix and npm I receive the following error:

These dependencies were not found:

* C:\Projects\project-name\resources\assets\js\cms\cms.js in multi ./resources/assets/js/cms/cms.js ./resources/assets/sass/cms/cms.scss ./resources/assets/sass/website/style.scss
* C:\Projects\project-name\resources\assets\js\website\website.js in multi ./resources/assets/js/website/website.js
* C:\Projects\project-name\resources\assets\sass\cms\cms.scss in multi ./resources/assets/js/cms/cms.js ./resources/assets/sass/cms/cms.scss ./resources/assets/sass/website/style.scss
* C:\Projects\project-name\resources\assets\sass\website\style.scss in multi ./resources/assets/js/cms/cms.js ./resources/assets/sass/cms/cms.scss ./resources/assets/sass/website/style.scss

To install them, you can run: npm install --save C:\Projects\project-name\resources\assets\js\cms\cms.js C:\Projects\project-name\resources\assets\js\website\website.js C:\Projects\project-name\resources\assets\sass\cms\cms.scss C:\Projects\project-name\resources\assets\sass\website\style.scss

So I tried reverting the update back but the error does not go away. When I empty to files to // the error still occurs. Only when removing the mix entries the error goes away.

My webpack.mix.js file:

const {mix} = require('laravel-mix');

mix.disableNotifications();

mix.options({
    processCssUrls: false
});

mix.js('resources/assets/js/cms/cms.js', 'public/build/js/cms.js')
    .js('resources/assets/js/website/website.js', 'public/build/js/website.js')
    .sass('resources/assets/sass/cms/cms.scss', 'public/build/css/cms.css')
    .sass('resources/assets/sass/website/style.scss', 'public/build/css/website.css');

if (mix.inProduction()) {
    mix.version();
}

The following scripts gives me that error:

npm run dev
npm run prod
npm run watch

My package.json:

{
	"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",
		"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": {
		"cross-env": "^5.0.1",
		"laravel-mix": "^1.1.1",
		"webpack": "2.2.0"
	},
	"dependencies": {
		"axios": "^0.15.2",
		"bootstrap-sass": "^3.3.7",
		"cropperjs": "^1.0.0-beta.2",
		"flatpickr": "^2.3.7",
		"jquery": "^3.1.0",
		"jquery-mousewheel": "^3.1.13",
		"lodash": "^4.16.2",
		"malihu-custom-scrollbar-plugin": "^3.1.5",
		"nouislider": "^9.2.0",
		"owl.carousel": "^2.2.0",
		"tinymce": "^4.6.4",
		"vue": "^2.0.1"
	},
	"eslintConfig": {
		"extends": "eslint:recommended",
		"parserOptions": {
			"ecmaVersion": 6,
			"sourceType": "module"
		},
		"env": {
			"browser": true,
			"node": true
		},
		"globals": {
			"_": true,
			"axios": true
		}
	}
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:9
  • Comments:52 (1 by maintainers)

github_iconTop GitHub Comments

29reactions
tsndrcommented, Jul 11, 2017

So the easiest fix for now is to downgrade to npm@5.1.0 using

npm i -g npm@5.1.0

Then cleanup and reinstall dependencies:

npm cache clean -f
rm -rf node_modules/ package-lock.json
npm i
16reactions
thijsvdankercommented, Jul 11, 2017

I had the same issue using laravel-mix on a non Laravel project. Running npm install --save-dev babel-loader babel-core babel-preset-env webpack fixed the issue for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dependencies not found error references my own files #983
So it seems like this is an issue related to npm not installing these dependencies properly.
Read more >
Could not get dependencies for project reference
When you get the error message "Could not get dependencies for project reference", one of the possible causes could be that you are...
Read more >
Manage references in a project - Visual Studio (Windows)
Right-click on the References or Dependencies node in the project that caused the error and choose Add Reference. Click the Windows tab and...
Read more >
Warnings from dependencies | Substance 3D Designer
Dependencies are other files referenced by a Substance 3D file (SBS). ... (error) No file that match this resource can be found.
Read more >
Go Modules Reference - The Go Programming Language
Introduction. Modules are how Go manages dependencies. This document is a detailed reference manual for Go's module system. For an introduction to creating ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found