Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

bower install not running #550

Closed
jimlongo56 opened this issue Nov 12, 2015 · 7 comments
Closed

bower install not running #550

jimlongo56 opened this issue Nov 12, 2015 · 7 comments

Comments

@jimlongo56
Copy link
Contributor

Hi, when I run npm install it does not by itself run bower install, I must run that manually.

How is the process setup so that this automatically gets fired when doing npm install?

Thanks for any help.

@jimlongo56
Copy link
Contributor Author

the error I'm getting is
npm WARN cannot run in wd foundationpress@1.7.0 bower install && grunt build (wd=/Users/jimlongo/Desktop/test6/wp-content/themes/my-theme)

@Luciaisacomputer
Copy link
Contributor

I ran into a similar issue the other day and had to run the command with sudo.

@jimlongo56
Copy link
Contributor Author

Yes, thanks. I have to run sudo npm install as well.
But it still gives me this error.
Then I can run bower install followed by grunt build

@olefredrik
Copy link
Owner

@jimlongo56 : There is a postinstall script in package.json making sure both bower install and grunt build are triggered automatically when doing npm install.

So this should work out of the box.

After the initial setup with npm install the following npm commands are available:
npm run build, npm run watch, npm run package, npm run browser-sync

If this is not working, there is probably an issue with your node or npm versions. Can you check what version you're on? (Type node -v and npm -v in your terminal). It could also be an issue with folder permissions on your local user account. What OS are you using?

@jimlongo56
Copy link
Contributor Author

Hi olefredrik, I'm pretty sure it must be a permissions issue as well. i'm running Mac OS 10.11.1, node 5.0.0, npm 2.9.1. I've searched for how to correct this permissions issue, since most searches indicate that npm scripts shouldn't need sudo, and I've tried to chown the folders/usr/local/bin/node and npm, but none of these have worked.

As I mentioned up top, the message that seems to indicate a problem occurring happens during npm install

npm WARN cannot run in wd foundationpress@1.7.0 bower install && grunt build (wd=/Users/jimlongo/Desktop/test/wp-content/themes/my-theme)

Since bower doesn't run none of the foundation elements are installed, so build, package, browser-sync, etc., cannot run without errors.

@olefredrik
Copy link
Owner

@jimlongo56 : Can you try using a mature and dependable version of nodejs instead? https://nodejs.org/en/ Not sure if v.5.0.0 will work with all of the devDependencies we're using.

The postinstall scripts (including bower install) will not run if you run into other errors during npm install.

(My personal opinion: npm is awesome when everything works as expected! But it can be a real pain in the ass when we're dealing with different devDependencies supporting different versions of node and so on.)

@jimlongo56
Copy link
Contributor Author

Thanks @olefredrik

I decided to spend some time sorting out my node installation. Took me a while the 4.2.2. binary installer didn't work at first. I had to completely remove every trace of node. I spent some time trying to install node with brew, and even though that was an improvement it had an issue where npm install would install every possible node module.

I finally went back to the binary installer and got node 4.2.2 and npm 2.14.7 installed. Now when I run npm install there is no need for sudo, and everything installs and runs including your post-install scripts.

Thanks again for your help, really appreciate it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants