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

npm run package: Cannot find module ../dist #411

Closed
erikcw opened this issue Sep 23, 2016 · 9 comments
Closed

npm run package: Cannot find module ../dist #411

erikcw opened this issue Sep 23, 2016 · 9 comments

Comments

@erikcw
Copy link

erikcw commented Sep 23, 2016

I'm trying to package a new electron app I'm building and I'm getting the following error:

macOS Sierra
node: 3.10.7
npm: v6.6.0

# npm run package

> electron-react-boilerplate@0.10.0 package /Users/erik/Dropbox/home/git/ddt-iframe/cluster-report
> cross-env NODE_ENV=production node -r babel-register -r babel-polyfill package.js

module.js:457
    throw err;
    ^

Error: Cannot find module '../dist'
    at Function.Module._resolveFilename (module.js:455:15)
    at Function.Module._load (module.js:403:25)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/erik/Dropbox/home/git/ddt-iframe/cluster-report/node_modules/.bin/cross-env:3:1)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)

npm ERR! Darwin 16.0.0
npm ERR! argv "/usr/local/Cellar/node/6.6.0/bin/node" "/usr/local/bin/npm" "run" "package"
npm ERR! node v6.6.0
npm ERR! npm  v3.10.7
npm ERR! code ELIFECYCLE
npm ERR! electron-react-boilerplate@0.10.0 package: `cross-env NODE_ENV=production node -r babel-register -r babel-polyfill package.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron-react-boilerplate@0.10.0 package script 'cross-env NODE_ENV=production node -r babel-register -r babel-polyfill package.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 electron-react-boilerplate package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     cross-env NODE_ENV=production node -r babel-register -r babel-polyfill package.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs electron-react-boilerplate
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls electron-react-boilerplate
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/erik/Dropbox/home/git/ddt-iframe/cluster-report/npm-debug.log

npm-debug.log.txt

@amilajack
Copy link
Member

amilajack commented Sep 23, 2016

What is inside of ../dist? Does it exist?

@erikcw
Copy link
Author

erikcw commented Sep 23, 2016

It's not any of my code. Looks like it's part of electron-react-boilerplate.

✗ ag '../dist'
app/app.html
11:        link.href = '../dist/style.css';
22:        script.src = (process.env.HOT) ? `http://localhost:${port}/dist/bundle.js` : '../dist/bundle.js';

README.md
93:<link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.css" />
94:<link rel="image/svg+xml" href="../node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.eot" />

webpack.config.development.js
20:    publicPath: `http://localhost:${port}/dist/`

webpack.config.production.js
15:    publicPath: '../dist/'

@amilajack
Copy link
Member

amilajack commented Sep 23, 2016

dist is generated by the boilerplate. I would recommend checking out our installation debugging solutions.

@amilajack
Copy link
Member

Did the solutions end up helping?

@erikcw
Copy link
Author

erikcw commented Sep 25, 2016

Yes it did! Thank you!

@erikcw erikcw closed this as completed Sep 25, 2016
@amilajack
Copy link
Member

Great! Which solution helped you? This repo has a lot of installation failures so it any kind of feedback is really helpful. Thanks!

@erikcw
Copy link
Author

erikcw commented Sep 25, 2016

Clearing the cache did the trick. Maybe package also those commands into a "fixit" script?

@amilajack
Copy link
Member

That would be a bit difficult. There are different solutions for each OS. Most of the installation issues are OS specific.

@axsaucedo
Copy link
Contributor

Awesome @amilajack, I can confirm this worked for me as well. Thanks!

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

No branches or pull requests

3 participants