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

Error while running npm run watch #375

Closed
krisnaw opened this issue Jul 4, 2015 · 17 comments
Closed

Error while running npm run watch #375

krisnaw opened this issue Jul 4, 2015 · 17 comments

Comments

@krisnaw
Copy link

krisnaw commented Jul 4, 2015

Hi there

So I already following your installation steps.
When I running this command "npm run watch", every single things that I change always got error notification in terminal and the command aborted.

file to import not found or unreadable: ../bower_components/foundation/scss/foundation/components/grid
Current dir: /Applications/MAMP/htdocs/wordpress/wp-content/themes/CopyCollision/scss/
Line 15 Column 9 scss/foundation.scss
Warning: Use --force to continue.

Aborted due to warnings.

@altjon
Copy link

altjon commented Jul 5, 2015

Does your bower_components folder exists in the theme root? If not, try:

npm install -g bower
and
bower update , for updating bower :)

@jessijean
Copy link

Hi.. I'm having the same issue:

Running "watch" task
Waiting...OK

File "scss/config/_custom-settings.scss" changed.

Running "sass:dist" (sass) task

file to import not found or unreadable: ../bower_components/foundation/scss/foundation/components/grid
Current dir: /var/www/vhosts/altmodel.io/httpdocs/wp-content/themes/altmodelio/scss/
Line 15 Column 9 scss/foundation.scss
Warning: Use --force to continue.

Aborted due to warnings.

I followed @altjon 's directions but still get the error.

@olefredrik
Copy link
Owner

It looks as if Grunt is struggling to find bower_components files. If you followed the instructions step by step, it should work. Check that your bower_components folder is in your projects. Then, check that the path of the bower_components folder is correct relative to the @import statements in app.less. I plan to make a new installation screencast over the next few days.

@krisnaw
Copy link
Author

krisnaw commented Jul 6, 2015

Problem solved

It's my fault. I edit the wrong scss files, that's why npm always say
errors.

Thanks
On Jul 6, 2015 5:07 PM, "Ole Fredrik Lie" [email protected] wrote:

It looks as if Grunt is struggling to find bower_components files. If you
followed the instructions step by step, it should work. Check that your
bower_components folder is in your projects. Then, check that the path of
the bower_components folder is correct relative to the @import
https://github.com/import statements in app.less. I plan to make a new
installation screencast over the next few days.


Reply to this email directly or view it on GitHub
#375 (comment)
.

@olefredrik
Copy link
Owner

👍

@RachelRVasquez
Copy link

@krisnaw Hi, I'm having a similar issue, what scss files were you editing that caused your error? If you don't mind sharing. :-) Thanks.

@olefredrik
Copy link
Owner

@RachelRVasquez : What error do you get?

@RachelRVasquez
Copy link

@olefredrik I've put all the details in a recent issue, but basically the same error. The bower_components folder not found/unreadable.

#379

@olefredrik
Copy link
Owner

@RachelRVasquez : Line 15-51 in foundation.scss is referencing the various foundation components, located in the bower_components folder. Have you checked that the bower_components folder is present on your disk?

@RachelRVasquez
Copy link

@olefredrik As I mentioned in #379, it is not present after I ran all the commands I needed to in terminal from the "Quick Start" instructions. I was confused whether this was a folder that was going to put itself there during the setup process or if I was supposed to manually create these paths?

I'd also repeated the process on a fresh install of FoundationPress in case it was something I did in my theme, but getting the same error.

@olefredrik
Copy link
Owner

@RachelRVasquez : npm install should take care of that. It is possible that the post install script haven't kicked in for some strange reason. (I suspect that npm postinstall is not fully supported in older versions of node.) Do you get any errors when running npm install?

Anyway, this is what you could do:

A) If you already have bower installed, you can do a bower install.

B) If you don't have bower installed, you can first do a sudo npm install bower -g and then bower install

@RachelRVasquez
Copy link

@olefredrik I'm currently in the theme's directory and running my terminal commands.

Step 1:

npm install gives me this:

npm WARN cannot run in wd [email protected] bower install && grunt build (wd=/usr/local/zend/apache2/htdocs/project-name/wordpress/wp-content/themes/my-theme)


Step 2:

And so I did an npm check with npm install -g npm-check and got this:

/usr/local/bin/npm-check -> /usr/local/lib/node_modules/npm-check/bin/cli.js
[email protected] /usr/local/lib/node_modules/npm-check
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected]
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])


Step 3:

'bower install' gives me this error:

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


Step 4:

So I tried sudo but then it tells me I don't need to use sudo for that command, and gives me this:

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

at Object.fs.openSync (evalmachine.<anonymous>:439:18)
at Object.fs.readFileSync (evalmachine.<anonymous>:290: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:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)

Last Step:

I finally ran sudo npm install bower -g and that seemed to run without errors:

/usr/local/bin/bower -> /usr/local/lib/node_modules/bower/bin/bower
[email protected] /usr/local/lib/node_modules/bower
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])


Conclusion (unresolved):

I still don't have that bower_components folder in my theme root though after that process. :-( I ran bower install again after that last command and still getting the error from the last time I ran bower install. I also just upgraded node using this tutorial in case.

Sorry I posted everything, but I'm hoping there's something in there that helps?

@olefredrik
Copy link
Owner

@RachelRVasquez : Nearly there. Now that you have bower installed globally (that's what you did in your last step), just type bower install while in your theme directory.

@RachelRVasquez
Copy link

@olefredrik Yep that's what I did, but I think I'm having a permissions issue. I'm not familiar enough with chmod to try randomly inserting google code though. :-)

Error: EACCES, permission denied '/Users/rachel/.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)

@olefredrik
Copy link
Owner

There's something weird going on here. This process will usually go smoothly. I recently purchased a new Macbook Pro. I installed Node.js and followed the quickstart step-by-step without any problems. So this is strange. In a way. Perhaps it may help to run a clean install of Node.js?

Found this related issue with bower and permission errors:
http://stackoverflow.com/questions/29865913/getting-a-permission-error-when-installing-with-bower

@RachelRVasquez
Copy link

@olefredrik YES I GOT IT! Sorry for the caps, but this is so exciting haha what a relief! Also got another error right after when I ran npm run watch again but this stack overflow fixed it with npm rebuild node-sass.

Finally runs the watch without errors and also have my bower_components file there with all the files. Thank you so much. 👍

@olefredrik
Copy link
Owner

Yay, you made it! Awesome :)

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

5 participants