Yeoman angularjs scaffolding error - node.js

I am trying to run this command:
yo angular
But it gives me this error:
**/usr/local/lib/node_modules/generator-angular/node_modules/wiredep/lib/detect-dependencies.js:84
if (_.isString(componentConfigFile.main)) {
^
TypeError: Cannot read property 'main' of undefined
at findMainFiles (/usr/local/lib/node_modules/generator-angular/node_modules/wiredep/lib/detect-dependencies.js:84:37)
at /usr/local/lib/node_modules/generator-angular/node_modules/wiredep/lib/detect-dependencies.js:146:17
at forOwn (/usr/local/lib/node_modules/generator-angular/node_modules/wiredep/node_modules/lodash/dist/lodash.js:1301:15)
at Function.forEach (/usr/local/lib/node_modules/generator-angular/node_modules/wiredep/node_modules/lodash/dist/lodash.js:2595:9)
at detectDependencies (/usr/local/lib/node_modules/generator-angular/node_modules/wiredep/lib/detect-dependencies.js:28:5)
at wiredep (/usr/local/lib/node_modules/generator-angular/node_modules/wiredep/wiredep.js:57:39)
at Generator._injectDependencies (/usr/local/lib/node_modules/generator-angular/app/index.js:326:5)
at /usr/local/lib/node_modules/generator-angular/node_modules/yeoman-generator/node_modules/async/lib/async.js:232:13
at /usr/local/lib/node_modules/generator-angular/node_modules/yeoman-generator/node_modules/async/lib/async.js:113:21
at /usr/local/lib/node_modules/generator-angular/node_modules/yeoman-generator/node_modules/async/lib/async.js:24:16**
How can I fix above error?
Note: I am running Ubuntu 14.04

The problem is Git was not installed, because yeoman tries to get bower_components via Git

I use nvm and came across this issue after installing and switching to the latest version of node. I realized I forgot to re-install bower globally:
npm install -g bower
After installing bower, the issue went away.

Related

Could not find module 'json-schema' while installing angular cli using npm

I am getting this error:
I am not able to install the angular cli using npm. I am getting the "cannot find module 'json-schema'" error. I tried reinstalling the node js and npm with the latest versions. But the error didn't resolve. Please help me with this.
This issue has a fix in the link below:
https://github.com/kriszyp/json-schema/issues/29
Good Luck
I uninstalled and installed node/npm/angular-cli many times. Finally did a "where ng" on my windows pc, and found the executable was under the %appdata%\npm directory. So after uninstalling node, deleting the %appdata%\npm directory, reinstalling node, and 'npm install -g angular-cli', the ng new and ng serve commands started working.

Installing npm packages in Webstorm 2017.1.3 / Ubuntu 16.04 LTS

When trying to create a new "Node.js Express App" in WebStorm 2017.1.3. / on Ubuntu 16.04 LTS. I get the following error: Please specify npm or yarn package.
So I installed the package globally using
$ sudo npm install -g express
and restarted WebStorm but still no luck.
I then tried the suggestions made in this thread: WebStorm - error: Please specify npm package. Again no luck.
I went on and tried to install the package using WebStorm, but still get the same error message:
Any ideas how I can get this running?
Starting with Express version 4, you should install express-generator.
npm install express-generator -g
More information on using express-generator

Can't install ExpressJS - npm is throwing an error

When I try to install ExpressJS with the command npm install -g express, I get the following errors:
What can I do about it?
I assume node -v gives 0.10.something.
Get rid of it and install a newer version of node from nodejs.org. Also try removing node_modules and npm install everything again.
Actually, I fixed the problem by uninstalling the latest version and installing the currently recommended one for most users - version 6.9.1.
The cause of the problem still remains unknown.

react-native : cannot find module 'npmlog'

I am trying to install react native on my windows 7 PC,
but unfortunately an error occurred during installation saying
Error: Cannot find module 'npmlog'
npm install -g react-native-cli //Success
react-native init AwesomeProject//missing module
Note that my node version is 4.3.1
What is missing?!.
It sounds like you possibly have a conflict with your npm version and your node version.
Re-installing node usually solves this issue.
I won't list them all, but a google search of the error will throw up hundreds of results. You can try fixing paths yourself, but generally best just to let the node installer handle it.
Re-installing npm may also resolve the issue
npm install -g npm

Yeoman for Angular, then "grunt serve" won't start

This is the first time I use yeoman to setup the scaffolding for an AngularJS app, and I have to admit I am likely new to the nodeJS, grunt and bower world.
So, here's what I've done so far:
I made sure yeoman, grunt-cli and the angular-generator packages are installed
npm install -g yo grunt-cli bower
npm install -g generator-angular
Generated my app
yo angular
I also tried:
yo angular --min-safe
So far, al seems good. Between the options given, I choose the Twitter Bootstrap one, no angular dependencies, and to overwrite my local .gitignore file.
After all that, I try to run my app:
grunt serve
At this point, grunt complains that it is not locally installed into the project, so I run:
npm install grunt --save-dev
No again, trying to run the app:
grunt serve
And this is where I get blocked:
C:\Projects\what-now>grunt serve
Running "serve" task
Running "clean:server" (clean) task
Running "concurrent:server" (concurrent) task
Running "copy:styles" (copy) task
Done, without errors.
Warning:
C:\Projects\what-now\node_modules\grunt-contrib-compass\node_modules\tmp\lib\tmp.js:261
throw err;
^
TypeError: Cannot read property 'stdout' of undefined
at compile (C:\Projects\what-now\node_modules\grunt-contrib-compass\tasks\compass.js:37:10)
at C:\Projects\what-now\node_modules\grunt-contrib-compass\tasks\compass.js:68:7
at C:\Projects\what-now\node_modules\grunt-contrib-compass\tasks\lib\compass.js:121:11
at _fileCreated (C:\Projects\what-now\node_modules\grunt-contrib-compass\node_modules\tmp\lib\tmp.js:172:7)
at C:\Projects\what-now\node_modules\grunt-google-cdn\node_modules\bower\node_modules\rimraf\node_modules\graceful-fs\graceful-fs.js:53:5
at C:\Projects\what-now\node_modules\grunt-google-cdn\node_modules\bower\node_modules\rimraf\node_modules\graceful-fs\graceful-fs.js:62:5
at OpenReq.Req.done (C:\Projects\what-now\node_modules\grunt-google-cdn\node_modules\bower\node_modules\fstream\node_modules\graceful-fs\graceful-fs.js:142:5)
at OpenReq.done (C:\Projects\what-now\node_modules\grunt-google-cdn\node_modules\bower\node_modules\fstream\node_modules\graceful-fs\graceful-fs.js:64:22)
//... stack trace continues ...
Looking at the code that blows up in compass' compile method, what I find is the following:
child.stdout.pipe(process.stdout);
This makes me think that child is undefined for some reason, and this variable comes from a call to grunt.util.spawn. This is where I am at a loss.
Am I missing any dependency? Am I missing any configuration?
Info:
OS: Windows 8 x64
node: v0.10.22
*sighs*, sorry.
All it took me is to write this question to then figure out I needed to have installed Ruby and the compass gem. Now it makes sense: the process for compiling would not spawn up.
After installing Ruby, run:
gem install compass
And you should be good to go.
EDIT: After you install Ruby, you need to make sure that the ruby runtime files' path is added to your PATH variable. (Thanks JagWire!)
On windows i had a few instalations of ruby:
C:\ruby187
and
C:\Ruby200-x64
install compass in both places, using:
gem install compass
this resolve my issue on windows 8 64bit
Following the same procedure for Ember, running grunt. Received the error "TypeError: Cannot read property 'stdout' of undefined." Did gem install compass (ruby had already been installed on my windows 7 64 bit) even though compass was supposed to be installed earlier and this worked. Ran grunt and grunt serve with no problems.

Resources