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.

mix.version() raise error

See original GitHub issue
  • Laravel Mix Version: #.#.# (npm list --depth=0)
├── cross-env@5.0.5
└── laravel-mix@1.4.5
  • Node Version (node -v): v8.6.0

  • NPM Version (npm -v): 5.3.0

  • OS: OSX El Capitan ( 10.11.6 )

Description:

My webpack.mix.js file contents:

const mix      = require('laravel-mix');
const min      = Mix.inProduction() ? '.min' : '';

mix.version();
// mix.sourceMaps();

 mix.js(`src/index.js`, `dist/index.js`);

When I add mix.version(); it raise error, but if i remove mix.version(); its works fine 😃

Error when mix.version(); used:

fs.js:653
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: ENOENT: no such file or directory, open '/dist/index.js'
    at Object.fs.openSync (fs.js:653:18)
    at Object.fs.readFileSync (fs.js:554:33)
    at File.read (/Users/xxx/node_modules/laravel-mix/src/File.js:180:19)
    at File.version (/Users/xxx/node_modules/laravel-mix/src/File.js:190:25)
    at Manifest.hash (/Users/xxx/node_modules/laravel-mix/src/Manifest.js:55:65)
    at manifest.forEach.file (/Users/xxx/node_modules/laravel-mix/src/plugins/CustomTasksPlugin.js:79:47)
    at Array.forEach (<anonymous>)
    at CustomTasksPlugin.applyVersioning (/Users/xxx/node_modules/laravel-mix/src/plugins/CustomTasksPlugin.js:79:18)
    at Compiler.compiler.plugin.stats (/Users/xxx/node_modules/laravel-mix/src/plugins/CustomTasksPlugin.js:12:22)
    at Compiler.applyPlugins (/Users/xxx/node_modules/tapable/lib/Tapable.js:61:14)
    at Watching._done (/Users/xxx/node_modules/webpack/lib/Compiler.js:104:17)
    at compiler.emitRecords.err (/Users/xxx/node_modules/webpack/lib/Compiler.js:78:19)
    at Compiler.emitRecords (/Users/xxx/node_modules/webpack/lib/Compiler.js:375:38)
    at compiler.emitAssets.err (/Users/xxx/node_modules/webpack/lib/Compiler.js:61:20)
    at applyPluginsAsyncSeries1.err (/Users/xxx/node_modules/webpack/lib/Compiler.js:368:12)
    at next (/Users/xxx/node_modules/tapable/lib/Tapable.js:218:11)
    at Compiler.compiler.plugin (/Users/xxx/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
    at Compiler.applyPluginsAsyncSeries1 (/Users/xxx/node_modules/tapable/lib/Tapable.js:222:13)
    at Compiler.afterEmit (/Users/xxx/node_modules/webpack/lib/Compiler.js:365:9)
    at require.forEach.err (/Users/xxx/node_modules/webpack/lib/Compiler.js:354:15)
    at /Users/xxx/node_modules/async/dist/async.js:421:16
    at iteratorCallback (/Users/xxx/node_modules/async/dist/async.js:998:13)
    at /Users/xxx/node_modules/async/dist/async.js:906:16
    at /Users/xxx/node_modules/graceful-fs/graceful-fs.js:43:10
    at FSReqWrap.oncomplete (fs.js:136:15)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! project@1.0.0 dev: `cross-env NODE_ENV=development node_modules/.bin/webpack --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the project@1.0.0 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/xxx/.npm/_logs/2017-10-02T20_09_33_527Z-debug.log

Steps To Reproduce:

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
EmranAhmedcommented, Oct 3, 2017

@talvbansal Your version is working fine, Just tested few min ago 👍

1reaction
talvbansalcommented, Oct 3, 2017

@EmranAhmed look at the PR i’ve just made and see if adding the same changes to your mix files in node_modules/laravel-mix fixes the issue for you please

Read more comments on GitHub >

github_iconTop Results From Across the Web

Large resource file causes mix.version() to throw a Fatal Error ...
I've added a video (40MB) to my resources and wanted mix to copy it into the public folder. When I also add the...
Read more >
Laravel mix 4 production build throw error at 92%
my project built and run pretty well on local machine with production environment but when i deploy it to server and run "npm...
Read more >
Versioning | Laravel Mix Documentation
version() method to enable file hashing, such as app.js?id=8e5c48eadbfdd5458ec6 . This is useful for cache-busting purposes. // 1. Version all compiled assets.
Read more >
Mix throwing error when after adding Vue : r/laravel - Reddit
vue() method for mix versions < 6. It's built-in and works out of the box. Mix "unbundled" vue only in the latest version....
Read more >
mix release — Mix v1.14.2 - HexDocs
A release can be configured in your mix.exs file under the :releases key inside def project : ... If the given name does...
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