node.js - Cannot npm install 'mean-cli' module on Mac OS X -


update: apparently, bad practice use sudo install node modules. instead, changing folder permissions solve issue.

see answer here: https://stackoverflow.com/a/31546496/2859315

original post:

currently, have installed node (version v0.12.7) , npm. trying install mean-cli package npm.

i following installation instructions found here: https://github.com/linnovate/mean#installation

also, taking mean stack development course on udemy. here lecture: https://www.udemy.com/mean-stack-for-beginners/#/lecture/2697540

so far, have installed both prerequisite packages, gulp , bower:

$ npm install -g gulp // , bower $ npm install -g bower  

firstly, tried installing using npm install -g mean-cli threw permission errors without using sudo. then, using sudo not work.

secondly, tried updating , reinstalling node , npm. still have same issue.

when type command sudo npm install -g mean-cli,

i response:

> mean-cli@0.10.14 preinstall /usr/local/lib/node_modules/mean-cli > node ./scripts/preinstall  shell-init: error retrieving current directory: getcwd: cannot access parent directories: permission denied node.js:720     var cwd = process.cwd();                   ^ error: eacces, permission denied     @ error (native)     @ function.startup.resolveargv0 (node.js:720:23)     @ startup (node.js:63:13)     @ node.js:814:3 npm err! darwin 14.4.0 npm err! argv "node" "/usr/local/bin/npm" "install" "-g" "mean-cli" npm err! node v0.12.7 npm err! npm  v2.11.3 npm err! code elifecycle  npm err! mean-cli@0.10.14 preinstall: `node ./scripts/preinstall` npm err! exit status 1 npm err!  npm err! failed @ mean-cli@0.10.14 preinstall script 'node ./scripts/preinstall'. npm err! problem mean-cli package, npm err! not npm itself. npm err! tell author fails on system: npm err!     node ./scripts/preinstall npm err! can info via: npm err!     npm owner ls mean-cli npm err! there additional logging output above.  npm err! please include following file support request: npm err!     /library/webserver/documents/nodejs/mean/npm-debug.log 

it seems problem lies here: failed @ mean-cli@0.10.14 preinstall script 'node, not sure how debug further.

any insight or helpful information appreciated! thanks!

apparently, bad practice use sudo install node modules. instead, changing folder permissions solve issue.

see answer here: https://stackoverflow.com/a/31546496/2859315


Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -