Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module '/var/www/test.xxx.com/shared/webpack.mix' #386

Closed
jrean opened this issue Feb 15, 2017 · 3 comments
Closed

Cannot find module '/var/www/test.xxx.com/shared/webpack.mix' #386

jrean opened this issue Feb 15, 2017 · 3 comments

Comments

@jrean
Copy link

jrean commented Feb 15, 2017

  • Laravel Mix Version: ^0.6.0
  • Node Version (node -v): 7.2.1
  • NPM Version (npm -v): 4.2.0
  • YARN Version: 0.20.3
  • OS: Ubuntu 16.10

Description:

My node_modules is symlinked.
lrwxrwxrwx 1 www-data xxx 45 Feb 15 10:16 node_modules -> /var/www/test.xxx.com/shared/node_modules

During my deployment when I run the yarn run production or npm run production command, it outputs the following:


> @ production /var/www/test.xxx.com/builds/20170215-101646
> 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

module.js:472
    throw err;
    ^

Error: Cannot find module '/var/www/test.xxx.com/shared/webpack.mix'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Mix.initialize (/var/www/test.xxx.com/shared/node_modules/laravel-mix/src/Mix.js:42:9)
    at Object.<anonymous> (/var/www/test.xxx.com/shared/node_modules/laravel-mix/setup/webpack.config.js:18:5)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at requireConfig (/var/www/test.xxx.com/shared/node_modules/webpack/bin/convert-argv.js:96:18)
    at /var/www/test.xxx.com/shared/node_modules/webpack/bin/convert-argv.js:109:17
    at Array.forEach (native)

npm ERR! Linux 4.8.0-34-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "production"
npm ERR! node v7.2.1
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ 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`
npm ERR! Exit status 1

npm ERR! Failed at the @ production script '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'.
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=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

The only hint I found is that:

Error: Cannot find module '/var/www/test.xxx.com/shared/webpack.mix'
    at Function.Module._resolveFilename (module.js:470:15)
...

Trying to find webpack.mix in '/var/www/test.xxx.com/shared/ which is of course won't work.

Stuck before deployment.

Please help :-)

Thxs

@jrean
Copy link
Author

jrean commented Feb 15, 2017

I tried to remove the symlink and to mv the node_modules directory and it works.
So it seems there is an issue following the link.

@JeffreyWay
Copy link
Collaborator

This is a duplicate thread, so closing.

But yeah, seems to be a known issue. Strange.

@jrean
Copy link
Author

jrean commented Feb 16, 2017

@JeffreyWay thxs
Can you indicate me the original thread? I can't find it.

The weird thing is it was properly working with Elixir!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants