Documentation suggestions/feedback

Hello.

I’m new to Sage. I’m reading the instructions at https://roots.io/sage/docs/theme-development/ and was going through the motions. Got to the part where I needed to run:

bower install

and got errors. Discovered here in the forums that what I really needed was

sudo npm install -g bower

Would like to suggest the docs list this.

Also it’d be nice if the section “Installing project dependencies” were included or moved into “Theme Installation

(Just some new user feedback I think would make things easier for others.)

We have you install bower here

If you have to run sudo npm -g ... something is wrong with your permissions and you need to follow Npm Debugging Guidelines (Failed npm install, bower install, or gulp build? Read this)

You should not have to run sudo to install npm modules globally.

1 Like

If you have to run sudo npm -g … something is wrong with your permissions

Running the latest version of Node and Bower (installed globally) and following the directions at Npm Debugging Guidelines (Failed npm install, bower install, or gulp build? Read this)

Running:

npm cache clear && rm -rf node_modules && npm install

results in:

npm ERR! Darwin 13.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "cache" "clear"
npm ERR! node v0.12.7
npm ERR! npm  v2.13.3
npm ERR! path /Users/jholtslander/.npm/vinyl/0.4.6
npm ERR! code EACCES
npm ERR! errno -13

npm ERR! Error: EACCES, rmdir '/Users/jholtslander/.npm/vinyl/0.4.6'
npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES, rmdir '/Users/jholtslander/.npm/vinyl/0.4.6']
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/Users/jholtslander/.npm/vinyl/0.4.6' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     /Applications/MAMP/htdocs/sage.com/wp-content/themes/sage/npm-debug.log

Following the directions at: https://docs.npmjs.com/getting-started/fixing-npm-permissions

I am the owner of /usr/local and from my sage folder I cannot run

bower install

…without errors:

Error: EACCES, permission denied '/Users/jholtslander/.config/configstore/bower-github.yml'
You don't have access to this file.

at Error (native)
at Object.fs.openSync (evalmachine.<anonymous>:500:18)
at Object.fs.readFileSync (evalmachine.<anonymous>:352:15)
at Object.create.all.get (/usr/local/lib/node_modules/bower/node_modules/configstore/index.js:34:29)
at Object.Configstore (/usr/local/lib/node_modules/bower/node_modules/configstore/index.js:27:44)
at readCachedConfig (/usr/local/lib/node_modules/bower/lib/config.js:22:23)
at defaultConfig (/usr/local/lib/node_modules/bower/lib/config.js:11:24)
at Object.<anonymous> (/usr/local/lib/node_modules/bower/lib/index.js:40:32)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)

The error messages you’ve provided are very clear. By originally using sudo you have messed up file permissions on your machine.

@benword How can I best resolve this?

Look into fixing the permissions on your home directory