Angular installation problems - angularjs

I am following along with TutsPlus Real time web apps with angularjs and firebase.
Referring to https://github.com/yeoman/generator-angular I ran
npm install -g grunt bower yo generator-karma generator-angular
After that I made a new project directory , cd into it and ran
yo angular which gave the following error:
events.js:85
throw er; // Unhandled 'error' event
^
Error: spawn grunt ENOENT
at exports._errnoException (util.js:746:11)
at Process.ChildProcess._handle.onexit (child_process.js:1046:32)
at child_process.js:1137:20
at process._tickCallback (node.js:355:11)
I have searched for ages now and can't find the specific reason for the error.
If someone could point me in the right direction please..
Thanks.
link to full output http://pastebin.com/GqJQV1Dg

Related

Next JS : Error: EPERM: operation not permitted, open

I am trying to build the next Js app production files to deploy it on cPanel, when I execute
npm run dev the app is working just fine but as I start to build a production file with the help of this video(https://youtu.be/1ykSXau838c) and executes npm run build it gives me an error in the terminal as given below:
PS C:\Users\hp\Desktop\reactJs-project\NextJs\test-app> npm run build
> test-app#0.1.0 build
> next build
info - Checking validity of types
info - Creating an optimized production build .node:events:368
throw er; // Unhandled 'error' event
^
Error: EPERM: operation not permitted, open 'C:\Users\hp\Desktop\reactJs-project\NextJs\test-app\.next\trace'
Emitted 'error' event on WriteStream instance at:
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -4048,
code: 'EPERM',
syscall: 'open',
path: 'C:\\Users\\hp\\Desktop\\reactJs-project\\NextJs\\test-app\\.next\\trace'
}
so I just want to know is there any way to solve this problem?
Posting comment from Koronag as an answer (as it helped me with this error and seems the most likely cause)...
This error is commonly seen when running a build while the dev server is already running. (E.g. in my case, I had a local build running via npm run dev and was trying to commit/push code, which invoked a Git Hook that also runs npm run dev.)
For me, it works fine this answer drives me to the resolver.
I run 2 scripts in terminals:
once for development
another for the build process.
So after killing the development script it looks perfectly fine!
From next-sitemap repo README.md
"Having next-sitemap command & next-sitemap.js file may result in file opening instead of building sitemaps in windows machines.
As a solution to this, it is now possible to use a custom config file instead of next-sitemap.js. Just pass --config .js to build command."
Next-Sitemap README.md - Building Sitemaps
The above worked for me

webdriver-manager error when calling update with "Unhandled 'error' event"

I currently have a project which uses jasmine and selenium on top of node.js. Protractor provides some useful modules which I would like to use, so I installed it and tried to run it using "protractor conf.js". I ended up getting the following errors:
[15:55:03] E/direct - Error code: 135
[15:55:03] E/direct - Error message: Could not find update-config.json. Run 'webdriver-manager update'
to download binaries.
[15:55:03] E/direct - Error: Could not find update-config.json. Run 'webdriver-manager update' to down
load binaries.
When I try to run webdriver-manager update, I get this:
[15:46:10] I/file_manager - creating folder C:\Program Files\node-v8.1.0-win-x86\node_modules\protract
or\node_modules\webdriver-manager\selenium
events.js:182
throw er; // Unhandled 'error' event
I saw some other threads with similar errors but they didn't seem to work for me. I suspect that this might be related to the fact that I want to run protractor without AngularJS, but I'm not sure since I believed it was possible to run protractor without angular. Any help would be appreciated.
EDIT: I tried setting "proxy_on" and "npm config set strict-ssl false" but ended up getting the following when running webdriver-manager-update:
events.js:182 throw er; Unhandled 'error' event
Error: self signed certificate in certificate chain at TLSSocket. (_tls_wrap.js:1098:38) at emitNone (events.js:105:13) at TLSSocket.emit (events.js:207:7) at TLSSocket._finishInit (_tls_wrap.js:628:8) at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:458:38)
Edit 2: Using npm 5.0.3, node 8.1.0, webbdriver-manager 12.0.6, OS: Windows 7

"No such file or directory, /src/app/templateCacheHtml.js" when running gulp build

I'm using the gulp-angular yeoman generator and if I create a new project, and then run gulp build or gulp serve:dist I get back this error:
Whenever I try to build my project, I get this error:
[16:03:56] gulp-inject 2 files into index.less. fs.js:887 return
binding.lstat(pathModule._makeLong(path)); ^
Error: ENOENT: no such file or directory, lstat
'/Users/danielrvt/IdeaProjects/rztest/src/app/templateCacheHtml.js' at
Error (native) at Object.fs.lstatSync (fs.js:887:18) at
DestroyableTransform.TransformStream as _transform at
DestroyableTransform.Transform.read
(/Users/danielrvt/IdeaProjects/rztest/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:159:10)
at DestroyableTransform.Transform._write
(/Users/danielrvt/IdeaProjects/rztest/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:147:83)
at doWrite
(/Users/danielrvt/IdeaProjects/rztest/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:313:64)
at writeOrBuffer
(/Users/danielrvt/IdeaProjects/rztest/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:302:5)
at DestroyableTransform.Writable.write
(/Users/danielrvt/IdeaProjects/rztest/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:241:11)
at write
(/Users/danielrvt/IdeaProjects/rztest/node_modules/gulp-concat/node_modules/readable-stream/lib/_stream_readable.js:623:24)
at flow
(/Users/danielrvt/IdeaProjects/rztest/node_modules/gulp-concat/node_modules/readable-stream/lib/_stream_readable.js:632:7)
at DestroyableTransform.pipeOnReadable
(/Users/danielrvt/IdeaProjects/rztest/node_modules/gulp-concat/node_modules/readable-stream/lib/_stream_readable.js:664:5)
at emitNone (events.js:80:13) at DestroyableTransform.emit
(events.js:179:7) at emitReadable
(/Users/danielrvt/IdeaProjects/rztest/node_modules/gulp-concat/node_modules/readable-stream/lib/_stream_readable.js:448:10)
at emitReadable
(/Users/danielrvt/IdeaProjects/rztest/node_modules/gulp-concat/node_modules/readable-stream/lib/_stream_readable.js:444:5)
at readableAddChunk
(/Users/danielrvt/IdeaProjects/rztest/node_modules/gulp-concat/node_modules/readable-stream/lib/_stream_readable.js:187:9)
Fix
The fix included in issue #37 has been released so the below workaround is no longer necessary. The error should not be present anymore after performing an npm update.
Cause
This error is being caused by a recent update (v1.8.3) in the gulp-header library.
An issue has already been created for you to track.
gulp-angular-templatecache has an indirect dependency on gulp-header, which is mentioned in a few of the comments.
Workaround
Until a fix is released, you can add a node dependency for the previous version of gulp-header to package.json. However, the ticket has been closed so a release should come shortly.
"dependencies": {
"gulp-header": "1.8.2"
}

Problems with grunt serve

I have project, but i can't run him. I use WebStorm IDE and after enter grunt serve I catch next errors:
grunt serve
Loading "connect.js" tasks...ERROR
>> SyntaxError: C:\Users\TT\Documents\ES\frontend\node_modules\grunt-contrib-connect\node_modules\connect\node_modules\type-is\node_modules\mime-types\node_modules\mime-db\db.json: Unexpect
ed end of input
Loading "cssmin.js" tasks...ERROR
>> Error: Cannot find module './source-map/source-map-generator'
Loading "jshint.js" tasks...ERROR
>> Error: Cannot find module 'jshint/src/cli'
Loading "uglify.js" tasks...ERROR
>> Error: Cannot find module 'pako/lib/zlib/messages'
Loading "cdnify.js" tasks...ERROR
>> SyntaxError: C:\Users\TT\Documents\ES\frontend\node_modules\grunt-google-cdn\node_modules\google-cdn\node_modules\cdnjs-cdn-data\external\cdnjs.json: Unexpected end of input
Loading "inline_angular_templates.js" tasks...ERROR
>> Error: Cannot find module 'domutils'
Running "serve" task
Warning: Task "connect:livereload" not found. Use --force to continue.
Aborted due to warnings.
Execution Time (2015-05-10 09:03:36 UTC)
loading tasks 18ms █████████████████████████████████████████████████████████████████████████████████████████████████████████ 56%
serve 11ms ████████████████████████████████████████████████████████████████ 34%
Total 32ms
Can you help me? How to fix it and what need install in order to this project earned?
I found a solution.
Here are the steps:
Remove nodejs and all npm's.
Install node
npm install
npm install -g bower
bower install
grunt serve
Success
um... run:
$ grunt -v
this will give you the missing (corrupted) node_modules. Sometimes things get corrupted or such.
I ran into this same problem with grunt-google-cdn and reinstalled it. with $ npm install grunt-google-cdn --save and everything went fine after that :)
reinstalling everything is generally not required.

Protractor 0.16.1 e2e AngularJS - Starting selenium standalone server... events.js:72 Error: spawn ENOENT

Attempted Project: https://github.com/yearofmoo/angularjs-seed-repo
Environment:
Windows 7 64-bit
NodeJS v 0.10.24
Protractor v 0.16.1
grunt v0.4.2
grunt-cli v0.1.11
Notes:
For selenium, install_selenium_standalone has been replaced by webdriver-manager binary around 12/2/13 according to [Julie's post][1]. This seems to be related to the issue.
Also, git must be installed in the project directory and npm install must be run using Git Bash in Windows.
Error in Git Bash:
$ grunt test:e2e --debug
Running "connect:testserver" (connect) task
[D] Task source: c:\nodejs-0.10.24\node_modules\grunt-contrib-connect\tasks\conn
ect.js
Started connect web server on 127.0.0.1:9999.
Running "protractor:singlerun" (protractor) task
[D] Task source: c:\nodejs-0.10.24\node_modules\grunt-protractor-runner\tasks\pr
otractor_runner.js
Starting selenium standalone server...
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:980:11)
at Process.ChildProcess._handle.onexit (child_process.js:771:34)
>
Fatal error: protractor exited with code: 8
Java is required to run selenium, so it seems You don't have any.

Resources