workshopper / how-to-npm

A module to teach you how to module.
https://www.npmjs.com/package/how-to-npm
ISC License
1.12k stars 220 forks source link

06, package.json file will not save and code will not verify #23

Closed CalliEliza closed 9 years ago

CalliEliza commented 9 years ago

When I try to update the package.json file to include my test.js I get the error:

ERR: Error: EACCES

It seems that for some reason I do not have access to change the json file.

linclark commented 9 years ago

What operating system are you using? If you're using Mac/Linux, the you might have run npm init using sudo. That would have made the superuser the owner of the package.json file.

You can check this by running ls -al in the same directory as the package.json file. If this is the problem, then you'll see a line that says something like this:

-rw-r--r-- 1 root staff 570 May 24 12:36 package.json

If this is the problem, then running the following command should fix it:

sudo chown `whoami` package.json
CalliEliza commented 9 years ago

I am running Linux. Thanks for you help. It was a sudo problem. That fixed it.

linclark commented 9 years ago

Glad to hear it worked :)