Closed backsapce closed 9 years ago
EACCES
? permissions for the css file?
It tries to write on node global expressworks
install. So it would work with sudo
.
I got a wrong solution (without the express.static
line) to pass, because both are failing similarly. Awkwardness.
~/code/js/expressworks tomppa$ expressworks verify exercise5.js
Verifying "STYLISH CSS"...
ACTUAL EXPECTED
------ --------
"Error: EACCES, open '/usr/local/lib/node_modules/expressworks/problems/stylish_css/public/main.css'" "Error: EACCES, open '/usr/local/lib/node_modules/expressworks/problems/stylish_css/public/main.css'"
# PASS
Your solution to STYLISH CSS passed!
vs.
~/code/js/expressworks tomppa$ sudo expressworks verify exercise5.js
Password:
Verifying "STYLISH CSS"...
ACTUAL EXPECTED
------ --------
"Cannot GET /main.css" != "p {"
"" != " color: #f00;"
null != "}"
null != ""
# FAIL
Your solution to STYLISH CSS didn't match the expected output.
Try again!
Oops?
I ran in to the same problem with this exercise and exercise 6. I just submitted an issue for exercise 6.
Verifying "STYLISH CSS"...
ACTUAL EXPECTED
------ --------
"p {" != "Cannot GET /main.css"
" color: #f00;" != ""
"}" != null
"" != null
# FAIL
Same problem here.
paulodiovani is correct. Run verify command using sudo.
Example:
$sudo expressworks verify filename.js
Verifying "STYLISH CSS"...
ACTUAL EXPECTED
------ --------
"p {" "p {"
" color: #f00;" " color: #f00;"
"}" "}"
"" ""
# PASS
@jgainfort Check out issue #42. The verify command under sudo doesn't work for me or others. It's not the right solution. On top of that, you shouldn't need sudo access to run through this tutorial
@mduleone your problem is different from the issue here. It is because npm doesn't have the right to read the provided css, hence sudo can solve the problem. yours is probably related to #30
Any way to get this lesson to pass? I typed the same solution as the one in the solution file for this lesson and even copied that solution to make sure I wasn't missing something and I can't get this to pass. Getting the same error as the OP
Sooooooo, my code works when I run it with node and I get the disered response in the browser. Previously I was getting what looked like errors on the 'expected' side of the checker and what looked like the correct answer on mine. Now for some reason the verify part of the program seems to have completely given up on me all I get is this and a blinking cursor in my terminal.
Verifying "STYLISH CSS"...
ACTUAL EXPECTED
------ --------
// blinking cursor of doom.
Perhaps running it as root will give it the push it needs to churn through the test but alas it won't give me the tick on my users account and I wont have that nice complete feeling....
my code below...
var express = require('express'),
app = express(),
dir = process.argv[3],
port = process.argv[2];
app.use(express.static(dir));
app.use(require('stylus').middleware(dir));
app.listen(Number(port));
ok I fixed it.
running my initial code to test it with my browser must have left something using the port expressworks wants, so I did killall node
to clear what ever my last program had left floating around. I then got the EACCES error some people are refering to above. I changed the file permisions in the relevant folder,
su -c 'chown GROUP:USR /usr/lib/node_modules/expressworks/problems/stylish_css/public/*'
which is a bit hacky, I suspect if you installed and ran expressworks locally as described in the README you wouldn't have that problem because you should have all the correct permisions already. neither solution is particually satisfying but atleast it passed the test.
The official solution provided in the first comment works for me now.
i have post the official solution but verify got wrong
the official solution