gruntjs - Unable to install Grunt through Terminal -
operating system: mac
so trying install grunt typing next terminal (through /usr/local/bin
):
npm install -g grunt-cli
but result:
error: eacces, mkdir '/usr/local/lib/node_modules/grunt-cli' npm err! { [error: eacces, mkdir '/usr/local/lib/node_modules/grunt-cli'] npm err! errno: 3, npm err! code: 'eacces', npm err! path: '/usr/local/lib/node_modules/grunt-cli', npm err! fstream_type: 'directory', npm err! fstream_path: '/usr/local/lib/node_modules/grunt-cli', npm err! fstream_class: 'dirwriter', npm err! fstream_stack: npm err! [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23', npm err! '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53', npm err! 'object.oncomplete (fs.js:107:15)' ] } npm err! npm err! please seek running command 1 time again root/administrator. npm err! scheme darwin 13.4.0 npm err! command "node" "/usr/local/bin/npm" "install" "-g" "grunt-cli" npm err! cwd /usr/local/bin npm err! node -v v0.10.32 npm err! npm -v 1.4.28 npm err! path /usr/local/lib/node_modules/grunt-cli npm err! fstream_path /usr/local/lib/node_modules/grunt-cli npm err! fstream_type directory npm err! fstream_class dirwriter npm err! code eacces npm err! errno 3 npm err! stack error: eacces, mkdir '/usr/local/lib/node_modules/grunt-cli' npm err! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23 npm err! fstream_stack /usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53 npm err! fstream_stack object.oncomplete (fs.js:107:15) npm err! npm err! additional logging details can found in: npm err! /usr/local/bin/npm-debug.log npm err! not ok code 0
...and doesn't happy! can help me out here?
note: tried doing usr
, without /local/bin
came errors too.
i same result (osx 10.9.5). doesn't matter you're running command - i'd expect you'd see exact same paths erroring out.
the problem appears npm wants set globally installed packages under /usr/local/
(per https://www.npmjs.org/doc/files/npm-folders.html, executables in /usr/local/bin
, modules in /usr/local/lib/node_modules
on *nix systems, here includes osx). not writable user on mac.
your options few:
you installing local project instead of globally (omit -g
). mean need reinstall bundle in other project in want utilize it. means you'll need set path
when access project point binaries (e.g., grunt
) under project (export path=$path:./node_modules/bin
), script, may still annoying.
you can run install 1 time again sudo
, there risks there (pointed out in http://stackoverflow.com/a/25259232/1795230).
finally, can alter 'prefix' (via npm config set prefix ~/npm
), presented here: http://stackoverflow.com/a/21712034/1795230. has downside of not beingness "global" real (just global projects of user) pointed out in comment npm won't install bundle on mac. new, clean build. `eacces` & other errors, may work out fine, depending on situation (works me on local dev machine).
terminal gruntjs
No comments:
Post a Comment