react-webpack-generators / generator-react-webpack

Yeoman generator for ReactJS and Webpack
http://newtriks.com/2013/12/31/automating-react-with-yeoman-and-grunt/
MIT License
2.88k stars 355 forks source link

npm run dist => reactWebpack/node_modules/.bin/copyfiles: Permission denied #297

Closed AlfredOdling closed 7 years ago

AlfredOdling commented 7 years ago

Hey! Im trying to deploy my site. When I run npm run dist I get this:

Alfreds-MacBook-Pro-2:reactWebpack Alfred$ npm run dist

templateApp@0.0.1 dist /Users/Alfred/React/newReactWebpack/reactWebpack npm run copy & webpack --env=dist

sh: /Users/Alfred/React/newReactWebpack/reactWebpack/node_modules/.bin/webpack: Permission denied

npm ERR! Darwin 16.1.0 npm ERR! argv "/usr/local/Cellar/node/6.2.2/bin/node" "/usr/local/bin/npm" "run" "dist" npm ERR! node v6.2.2 npm ERR! npm v3.9.5 npm ERR! code ELIFECYCLE npm ERR! templateApp@0.0.1 dist: npm run copy & webpack --env=dist npm ERR! Exit status 126 npm ERR! npm ERR! Failed at the templateApp@0.0.1 dist script 'npm run copy & webpack --env=dist'. 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 templateApp package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! npm run copy & webpack --env=dist npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs templateApp npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls templateApp npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /Users/Alfred/React/newReactWebpack/reactWebpack/npm-debug.log

templateApp@0.0.1 copy /Users/Alfred/React/newReactWebpack/reactWebpack copyfiles -f ./src/index.html ./src/favicon.ico ./dist

sh: /Users/Alfred/React/newReactWebpack/reactWebpack/node_modules/.bin/copyfiles: Permission denied

npm ERR! Darwin 16.1.0 npm ERR! argv "/usr/local/Cellar/node/6.2.2/bin/node" "/usr/local/bin/npm" "run" "copy" npm ERR! node v6.2.2 npm ERR! npm v3.9.5 npm ERR! code ELIFECYCLE npm ERR! templateApp@0.0.1 copy: copyfiles -f ./src/index.html ./src/favicon.ico ./dist npm ERR! Exit status 126 npm ERR! npm ERR! Failed at the templateApp@0.0.1 copy script 'copyfiles -f ./src/index.html ./src/favicon.ico ./dist'. 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 templateApp package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! copyfiles -f ./src/index.html ./src/favicon.ico ./dist npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs templateApp npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls templateApp npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /Users/Alfred/React/newReactWebpack/reactWebpack/npm-debug.log

There seems to be a problem with npm copyfiles and the nodemodules.. Does anyone know whats going on?

Thanks

ajnudnyy commented 7 years ago

You can add sudo if did this operation on mac device ! I deployed successfully .

weblogixx commented 7 years ago

Hi @ajnudnyy,

I would recommend to use nvm (https://github.com/creationix/nvm) to manage your node.js installations. This tool makes it possible to use multiple versions of node.js on the same system without problems. Also, unlike the "original" node installer for linux and osx, you will be able to run npm install -g without sudo. Permission-Problems are much easier to handle this way.

Please feel free to reopen this issue if you have any further issues with this.