iansinnott / react-static-boilerplate

A boilerplate for building static sites with Webpack 2, React and React Router
107 stars 16 forks source link

`npm run build` failing #12

Closed dunphyben closed 8 years ago

dunphyben commented 8 years ago

I am able to run npm run build successfully when I clone this boilerplate fresh.
The code I have issues with was a clone of the realworldreact.com code, which I assume already had the npm run build and npm run deploy commands run on it. This is likely the issue, but I'm not sure how to fix it.
The repo in question is https://github.com/realworldreact/reactathon.com
Here are the output log errors:

ben$ npm run build

> reactathon.com@0.3.2 build /Users/ben/Dropbox/DB-code/2016/react-static/reactathon.com
> npm run clean && npm run build:static && npm run build:cname

> reactathon.com@0.3.2 clean /Users/ben/Dropbox/DB-code/2016/react-static/reactathon.com
> rimraf public

module.js:442
    throw err;
    ^

Error: Cannot find module './'
    at Function.Module._resolveFilename (module.js:440:15)
    at Function.Module._load (module.js:388:25)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/ben/Dropbox/DB-code/2016/react-static/reactathon.com/node_modules/.bin/rimraf:3:14)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)

npm ERR! Darwin 15.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "clean"
npm ERR! node v6.3.1
npm ERR! npm  v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! reactathon.com@0.3.2 clean: `rimraf public`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the reactathon.com@0.3.2 clean script 'rimraf public'.
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 reactathon.com package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     rimraf public
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs reactathon.com
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls reactathon.com
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/ben/Dropbox/DB-code/2016/react-static/reactathon.com/npm-debug.log

npm ERR! Darwin 15.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
npm ERR! node v6.3.1
npm ERR! npm  v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! reactathon.com@0.3.2 build: `npm run clean && npm run build:static && npm run build:cname`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the reactathon.com@0.3.2 build script 'npm run clean && npm run build:static && npm run build:cname'.
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 reactathon.com package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run clean && npm run build:static && npm run build:cname
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs reactathon.com
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls reactathon.com
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/ben/Dropbox/DB-code/2016/react-static/reactathon.com/npm-debug.log
iansinnott commented 8 years ago

Not sure what the issue here is. I was unable to repro in that repository.

However this did bring to light a bug in the underlying webpack plugin, which has now been fixed.

iansinnott commented 8 years ago

Updated the plugin dependency and still wasn't able to repro. Try a fresh install of dependencies and run again:

rm -rf node_modules && npm install && npm run build
dunphyben commented 8 years ago

Amazing, that worked 👍

Thanks for the assistance