I tried to run yo angular
in a new project directory, but it gave me the ENOENT error somewhere along the way. Yes I have looked at this similar question, but i
My problem was a broken package.json. Maybe this will help someone.
EDIT: npm update -g
followed by npm cache clear
should work for most. However, when first installing on Mac OS you may need to navigate to your usr/local/lib/node_modules
folder once nodeJS is first installed and grant read/write permission to "Everyone". Node won't be able to installed additional workflow components globally until those permissions are released. You don't want to sudo the npm install commands, because then those tools won't have sudo access to run after the fact. Read/write permissions are changed by right-clicking the folder and going to "Get info" then changing permissions at bottom of popup.
I had this same issue on Windows 7 machine. Here are the steps I took to resolve:
npm update -g
npm cache clear
npm install -g yo
npm cache clear
npm install -g generator-angular
npm cache clear
yo angular test
npm cache clear
grunt serve
I did run into some other issues with karma.conf.js where the paths had a \
instead of /
for bower_components. Also, I noticed the optional angular modules were injected in my app.js despite not including them all in my yo build from the cli. I have reported these issues on github.
npm ERR! command "/home/ubuntu/local/bin/node"
Are you installing in a user directory? I did and had ENOENT errors too.
I had to mkdir some directories. If they're not there, try creating some of the directories in the debug.log, like lib/node_modules.
These ENOENT
(and sometimes EACCES
) errors are often caused by old versions of npm
. Unfortunately even the latest version of node
does not distribute the current version of npm
.
After installing node
, run npm -v
. If you don't see 2.1.18
or later, you should upgrade following the official instructions here https://github.com/npm/npm/wiki/Troubleshooting#try-the-latest-stable-version-of-npm
On OSX the quick way to upgrade is sudo npm install -g npm@latest
On Windows, follow the guide in the wiki or read this answer How do I update npm on Windows?
cmd.exe
cd C:\Program Files (x86)\nodejs
npm install npm@latest
Update node (and npm) to the latest version, and this should solve the issue.