saikat / react-apollo-starter-kit

A production-ready starter kit for making a React/Apollo application.
MIT License
186 stars 28 forks source link

EACCESS Error on 'npm run prod-build' #2

Closed vwrobel closed 8 years ago

vwrobel commented 8 years ago

Hi Saikat,

So far I find your starter kit very clear: thank you for your work! run dev works fine but I get an error with your repo 'as is' just after git clone when I launch prod-build

macbook-pro-de-vw:react-apollo-starter-kit vwrobel$ npm run prod-build

> spoke@1.0.0 prod-build /Users/vwrobel/Projets/react-apollo-starter-kit
> npm run clean && npm run prod-build-client && npm run prod-build-server

> spoke@1.0.0 clean /Users/vwrobel/Projets/react-apollo-starter-kit
> rm -rf $OUTPUT_DIR

> spoke@1.0.0 prod-build-client /Users/vwrobel/Projets/react-apollo-starter-kit
> webpack --config ./webpack/config.js

Error: EACCES: permission denied, open '/bundle.js'
    at Error (native)

npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/Cellar/nvm/0.31.2/versions/node/v6.2.2/bin/node" "/usr/local/Cellar/nvm/0.31.2/versions/node/v6.2.2/bin/npm" "run" "prod-build-client"
npm ERR! node v6.2.2
npm ERR! npm  v3.9.5
npm ERR! code ELIFECYCLE
npm ERR! spoke@1.0.0 prod-build-client: `webpack --config ./webpack/config.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the spoke@1.0.0 prod-build-client script 'webpack --config ./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 spoke package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     webpack --config ./webpack/config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs spoke
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls spoke
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/vwrobel/Projets/react-apollo-starter-kit/npm-debug.log

npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/Cellar/nvm/0.31.2/versions/node/v6.2.2/bin/node" "/usr/local/opt/nvm/versions/node/v6.2.2/bin/npm" "run" "prod-build"
npm ERR! node v6.2.2
npm ERR! npm  v3.9.5
npm ERR! code ELIFECYCLE
npm ERR! spoke@1.0.0 prod-build: `npm run clean && npm run prod-build-client && npm run prod-build-server`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the spoke@1.0.0 prod-build script 'npm run clean && npm run prod-build-client && npm run prod-build-server'.
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 spoke 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 prod-build-client && npm run prod-build-server
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs spoke
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls spoke
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/vwrobel/Projets/react-apollo-starter-kit/npm-debug.log

I cannot find a fix to that error. Do you have any idea of what might cause that?

Thank you for your time.

vwrobel commented 8 years ago

OK I need to set env variables for Node from .env...

grayontheweb commented 8 years ago

@vwrobel I'm also having this error, can you tell me how you fixed it?

vwrobel commented 8 years ago

Hello @grayontheweb. Unfortunatelly I just tested this package months ago and cannot remember precisely. I just remember that I had to set the env variables from the .env file in the root directory, one way or another. May be you can have a look at the dotenv package.

jsarapik commented 7 years ago

@grayontheweb Did you manage to figure it out? I am having the same issue.

I am running the same build command through foreman so it loads the .env file, but i still get Error: EACCES: permission denied, open '/bundle.js'

EDIT I was trying to run prod-build in development mode, hence the errors.

To load env variables I added this to the top of webpack server.js and config.js

var dotenv = require('dotenv'); dotenv.load();

No more errors :)