Laravel-mix: This dependency was not found in node_modules: * pace

Created on 15 Feb 2017  路  8Comments  路  Source: JeffreyWay/laravel-mix

When I do

```mix.js([

'resources/assets/js/core/libraries/jquery.min.js', // 2.1.4
'resources/assets/js/core/libraries/bootstrap.min.js', // v3.3.6
'resources/assets/js/core/app.js',

], 'public/js/guest_app.js');

it works well

but when I add a line:

```mix.js([
    'resources/assets/js/plugins/loaders/pace.min.js',
    'resources/assets/js/core/libraries/jquery.min.js', // 2.1.4
    'resources/assets/js/core/libraries/bootstrap.min.js', // v3.3.6
    'resources/assets/js/core/app.js',
], 'public/js/guest_app.js');

I get :

 ERROR  Failed to compile with 1 errors

This dependency was not found in node_modules:

* pace

Did you forget to run npm install --save for it?
            Asset      Size  Chunks                    Chunk Names
 /js/guest_app.js    482 kB       0  [emitted]  [big]  /js/guest_app
mix-manifest.json  44 bytes          [emitted]         

npm ERR! Darwin 16.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dev"
npm ERR! node v6.9.4
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! @ dev: `node node_modules/cross-env/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`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the @ dev script 'node node_modules/cross-env/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'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node node_modules/cross-env/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
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs 
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls 
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/user/Documents/Proyectos/laravel/npm-debug.log

I checked that the file : resources/assets/js/plugins/loaders/pace.min.js, exists.

  • Laravel Mix Version: 0.6.0
  • Node Version (node -v): v6.9.4
  • NPM Version 3.10.10
  • OS: Mac OS X Sierra

package.json

{ "private": true, "scripts": { "dev": "node node_modules/cross-env/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/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", "hot": "node node_modules/cross-env/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/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": { "axios": "^0.15.2", "laravel-mix": "^0.6.0", "jquery": "^3.1.0", "lodash": "^4.16.2", "vue": "^2.0.1", "vue-resource": "^0.9.3", "phantomjs-prebuilt": "^2.1.7" } }

Why is it asking me for pace module?

Most helpful comment

That solved it. Not sure why that wasn't installed. Using regular NPM, not Yarn.

All 8 comments

What method are you calling here?

    'resources/assets/js/core/libraries/jquery.min.js', // 2.1.4
    'resources/assets/js/core/libraries/bootstrap.min.js', // v3.3.6
    'resources/assets/js/core/app.js',
], 'public/js/guest_app.js');

Is that mix.combine() or mix.js()?

After upgrading from 0.5.3 to 0.7.5, I'm getting the same error for:

mix.sass('resources/assets/sass/styles.scss', 'public/css');
This dependency was not found in node_modules:

* /Users/Foo/Development/Sites/foobar/resources/assets/sass/styles.scss

However this works fine:

mix.js('resources/assets/js/app.js', 'public/js');

If someone can give me a simple steps to reproduce this in a fresh project, that would be perfect.

This is what the macOS notification is showing. It seems like the real error is hidden from the CLI output.

screen shot 2017-02-15 at 1 43 08 pm

When I set mix.options({ processCssUrls: true }); the files are compiled without an issue.

Seems like it's related to this part in webpack.config.js:

let loaders = [
    { loader: (Mix.options.processCssUrls ? 'css-loader' : 'raw-loader') + sourceMap },
    { loader: 'postcss-loader' + sourceMap }
];

Try doing npm install raw-loader.

This should have been done automatically when you installed it. https://github.com/JeffreyWay/laravel-mix/blob/master/package.json#L49

That solved it. Not sure why that wasn't installed. Using regular NPM, not Yarn.

Thanks @JeffreyWay!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jpmurray picture jpmurray  路  3Comments

rderimay picture rderimay  路  3Comments

wendt88 picture wendt88  路  3Comments

nezaboravi picture nezaboravi  路  3Comments

stefensuhat picture stefensuhat  路  3Comments