1

I have installed mean.io and ran sudo npm install. Actually following commands in sequence

sudo npm install -g meanio
mean init yourNewApp
cd yourNewApp
sudo npm install -g bower
sudo npm install

It is supposed to download and install angularjs libraries into public/system/lib. After doing the above steps public /system/lib is not created due to which when I start the application I get the error

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: ENOENT, open '/home/santhosh/dev/scaleqa/mean_tut/old mean/temp/myapp/public/system/lib/bootstrap/dist/css/bootstrap.css'
[nodemon] app crashed - waiting for file changes before starting...

Is it something to do with certain npm/angularjs server being down. I have faced this problem earlier also but got fixed on 2nd try and I didn't bother to do more research. This became a big issue when I try to pull my repo into cloud and start the application. public/system/lib is added in .gitignore by default and is expected to be created during npm install.

I get following warnings with sudo npm install

npm WARN package.json mean-connect-mongo@0.4.3 No repository field.
npm WARN cannot run in wd mean@0.3.3 node node_modules/bower/bin/bower install (wd=/home/santhosh/dev/scaleqa/mean_tut/old mean/temp/myapp)

this is link to package.json

raju
  • 4,788
  • 15
  • 64
  • 119

1 Answers1

3

The problem maybe related to running npm install as sudo, which can cause problems. As mentioned in another stack overflow question, this can be worked around in a couple ways. But because it looks like this is being run from your home directory, you really shouldn't need to run npm install as root.

Try to issue the same commands, but the last without sudo:

sudo npm install -g meanio
mean init yourNewApp
cd yourNewApp
sudo npm install -g bower
npm install

Note that the reason you may need to run npm install -g <package> using sudo is because by default npm uses /usr/local for global installs, which can be a restricted directory. However, when you install a package locally (without the -g flag) you should not need to run as root.

dylants
  • 22,316
  • 3
  • 26
  • 22
  • I got the error mentioned in http://stackoverflow.com/questions/16151018/npm-throws-error-without-sudo but solved with sudo chown -R `whoami` .npm – raju May 30 '14 at 03:22
  • If you're still getting errors when running `npm install`, try running `npm cache clear` and try again. – hansn Jul 15 '14 at 20:45