Laravel-mix: Dependencies were not found

Created on 12 Jul 2017  路  14Comments  路  Source: JeffreyWay/laravel-mix

  • Laravel Mix Version: 1.2.0 (npm list --depth=0)
  • Node Version (node -v): 8.1.4
  • NPM Version (npm -v): 5.2.0
  • OS: macOS Sierra 10.12.5 (16F73)

Description:

Although app.js and app.scss exist, NPM doesn't compile.

Steps To Reproduce:

  1. Install Laravel
  2. Install NPM npm install
  3. Run npm run dev or npm run production

Here is the output;

> @ dev /Users/burak/Sites/laravel5
> npm run development


> @ development /Users/burak/Sites/laravel5
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

 95% emitting

 ERROR  Failed to compile with 2 errors                                                     16:49:26

These dependencies were not found:

* /Users/burak/Sites/laravel5/resources/assets/js/app.js in multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss
* /Users/burak/Sites/laravel5/resources/assets/sass/app.scss in multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss

To install them, you can run: npm install --save /Users/burak/Sites/laravel5/resources/assets/js/app.js /Users/burak/Sites/laravel5/resources/assets/sass/app.scss
     Asset     Size  Chunks             Chunk Names
/js/app.js  2.78 kB       0  [emitted]  /js/app
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ development: `cross-env 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 @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/burak/.npm/_logs/2017-07-12T13_49_26_389Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/burak/.npm/_logs/2017-07-12T13_49_26_428Z-debug.log

Most helpful comment

@straube Clear your cache too. So try this:

  1. npm -v shouldn't return 5.2
  2. rm -rf node_modules
  3. npm cache clear
  4. rm -rf package-lock.json
  5. npm install

All 14 comments

Same problem, with:

  • node: 6.10.1
  • npm: 5.2.0
  • laravel-mix: 1.2.0
  • OS: Windows 10

It's a known issue with npm 5.2. Downgrade to an earlier release until they push out the fix.

https://github.com/npm/npm/issues/17717

@JeffreyWay Downgrading to npm 5.1.0 didn't work for me. I'm still getting that same error. Should I use some other specific version?

$ sudo npm install -g [email protected]

Thanks!

BTW, I have removed the node_modules dir and ran npm install again before trying to compile the assets.

@straube Clear your cache too. So try this:

  1. npm -v shouldn't return 5.2
  2. rm -rf node_modules
  3. npm cache clear
  4. rm -rf package-lock.json
  5. npm install

Finally! It's working! :tada:

A side note: I had to add the --force flag to get the cache cleared:

npm cache clear --force

Or install yarn and never deal with the limitations of a broken cli. 馃憤

I found the only way around this was to manually install sass-loader, babel-loader and vue-loader. Tried nuking node_modules, clearing the npm cache and removing package-lock.json, but still kept hitting the same error. Can also confirm that it only started happening when I upgraded to npm 5.2.

@ dev C:\laragonwww\tradenavigator
npm run development

@ development C:\laragonwww\tradenavigator
cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modul
vel-mix/setup/webpack.config.js

95% emitting

ERROR Failed to compile with 2 errors 1:5

error in ./resources/assets/sass/site.scss

Module build failed:
@import "/node_modules/bootstrap-sass/assets/stylesheets/bootstrap";
^
File to import not found or unreadable: /node_modules/bootstrap-sass/assets/stylesheets/bootstrap.
Parent style sheet: stdin
in C:\laragonwww\tradenavigator\resources\assets\sass\site.scss (line 10, column 1)

@ ./resources/assets/sass/site.scss 4:14-267
@ multi ./resources/assets/js/site.js ./resources/assets/sass/site.scss

error in ./resources/assets/sass/site.scss

Module build failed: ModuleBuildError: Module build failed:
@import "/node_modules/bootstrap-sass/assets/stylesheets/bootstrap";
^
File to import not found or unreadable: /node_modules/bootstrap-sass/assets/stylesheets/bootstrap.
Parent style sheet: stdin
in C:\laragonwww\tradenavigator\resources\assets\sass\site.scss (line 10, column 1)
at runLoaders (C:\laragonwww\tradenavigatornode_moduleswebpack\lib\NormalModule.js:194:19)
at C:\laragonwww\tradenavigatornode_modules\loader-runner\lib\LoaderRunner.js:364:11
at C:\laragonwww\tradenavigatornode_modules\loader-runner\lib\LoaderRunner.js:230:18
at context.callback (C:\laragonwww\tradenavigatornode_modules\loader-runner\lib\LoaderRunner.js:111:13)
at Object.asyncSassJobQueue.push [as callback] (C:\laragonwww\tradenavigatornode_modules\sass-loader\lib\loa
55:13)
at Object. (C:\laragonwww\tradenavigatornode_modules\async\dist\async.js:2244:31)
at Object.callback (C:\laragonwww\tradenavigatornode_modules\async\dist\async.js:906:16)
at options.error (C:\laragonwww\tradenavigatornode_modules\node-sass\libindex.js:294:32)

      Asset     Size  Chunks                    Chunk Names

/js/vendor.js 649 kB 0 [emitted] [big] /js/vendor
\js\site.js 566 kB 1 [emitted] [big] \js\site
\js\manifest.js 5.82 kB 2 [emitted] \js\manifest
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ development: cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modu onfig=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\sxp\AppData\Roaming\npm-cache_logs\2017-08-15T19_51_30_375Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ dev: npm run development
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\sxp\AppData\Roaming\npm-cache_logs\2017-08-15T19_51_30_787Z-debug.log

my node v is v6.9.4 and npm is 5.1.0 not able to compile or run production it is throwing this error plz help some one

@soujanyaui Remove node_modules and use ~ for the path.

nothing fixed the issue. installed yarn and did
sudo yarn install -no-bin-links
and everything went smooth

Please help me ...

npm run dev
@ dev /var/www/html/screp
npm run development
@ development /var/www/html/screp
cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
95% emitting

ERROR Failed to compile with 1 errors 00:33:59

This dependency was not found:

/var/www/html/screp/resources/assets/sass/app.scss in multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss
To install it, you can run: npm install --save /var/www/html/screp/resources/assets/sass/app.scss
Asset Size Chunks Chunk Names
/js/app.js 4.12 kB 0 [emitted] /js/app

ERROR in ./resources/assets/js/app.js
Module build failed: ReferenceError: Unknown plugin "transform-object-rest-spread" specified in "base"t > 0, attempted to resolve relative to "/var/www/html/screp/resources/assets/js"
at /var/www/html/screp/node_modules/babel-core/lib/transformation/file/options/option-manager.js:180:17

at Array.map ()
at Function.normalisePlugins (/var/www/html/screp/node_modules/babel-core/lib/transformation/file/options/option-manager.js:158:20)
at OptionManager.mergeOptions (/var/www/html/screp/node_modules/babel-core/lib/transformation/file/options/option-manager.js:234:36)
at OptionManager.init (/var/www/html/screp/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
at File.initOptions (/var/www/html/screp/node_modules/babel-core/lib/transformation/file/index.js:212:65)
at new File (/var/www/html/screp/node_modules/babel-core/lib/transformation/file/index.js:135:24)
at Pipeline.transform (/var/www/html/screp/node_modules/babel-core/lib/transformation/pipeline.js:46:16)
at transpile (/var/www/html/screp/node_modules/babel-loader/lib/index.js:50:20)
at /var/www/html/screp/node_modules/babel-loader/lib/fs-cache.js:118:18
at ReadFileContext.callback (/var/www/html/screp/node_modules/babel-loader/lib/fs-cache.js:31:21)
at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:437:13)
@ multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss
ERROR in multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss>
Module not found: Error: Can't resolve 'css-loader' in '/var/www/html/screp'
@ multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss

npm install bootstrap-sass --save-dev

image
someone help me for this error. I search google for this and try some ways but it still not work for me.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Usershp\AppData\Roaming\npm-cache_logs\2018-10-03T18_23_15_598Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ dev: npm run development
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Usershp\AppData\Roaming\npm-cache_logs\2018-10-03T18_23_15_716Z-debug.log

hp@Hp-pc MINGW64 /c/xampp/htdocs/admincrud
$ ^C

hp@Hp-pc MINGW64 /c/xampp/htdocs/admincrud

I am getting these errors when i try to run comment (npm run dev). Your help would be appreciated.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mstralka picture mstralka  路  3Comments

rlewkowicz picture rlewkowicz  路  3Comments

RomainGoncalves picture RomainGoncalves  路  3Comments

hasnatbabur picture hasnatbabur  路  3Comments

nezaboravi picture nezaboravi  路  3Comments