NodeJS and Gulp throws an error - node.js

I am having a problem when I try to run Gulp watch.
Here's the error being thrown:
[15:42:57] Using gulpfile ~/bartslaw-nyc/Gulpfile.js
[15:42:57] Starting 'browserSync'...
[15:42:57] Finished 'browserSync' after 17 ms
[15:42:57] Starting 'clean'...
[15:42:57] Finished 'clean' after 5.25 ms
[15:42:57] Starting 'pages'...
[15:42:57] 'pages' errored after 6.59 ms
[15:42:57] TypeError: Cannot read property 'length' of undefined
at flattenGlob (/home/k7/bartslaw-nyc/node_modules/glob2base/index.js:9:25)
at setToBase (/home/k7/bartslaw-nyc/node_modules/glob2base/index.js:48:12)
at module.exports (/home/k7/bartslaw-nyc/node_modules/glob2base/index.js:56:19)
at Object.gs.createStream (/home/k7/bartslaw-nyc/node_modules/glob-stream/index.js:34:42)
at Object.gs.create (/home/k7/bartslaw-nyc/node_modules/glob-stream/index.js:68:42)
at Gulp.src (/home/k7/bartslaw-nyc/node_modules/vinyl-fs/lib/src/index.js:33:23)
at Gulp.<anonymous> (/home/k7/bartslaw-nyc/Gulpfile.js:44:15)
at module.exports (/home/k7/bartslaw-nyc/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/home/k7/bartslaw-nyc/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/home/k7/bartslaw-nyc/node_modules/orchestrator/index.js:214:10)
[BS] Access URLs:
------------------------------------
Local: http://localhost:3000
External: http://192.168.1.3:3000
------------------------------------
UI: http://localhost:3001
UI External: http://192.168.1.3:3001
------------------------------------
[BS] Serving files from: _build
The issue is that on my browser there's just "Cannot GET /". Help me out on this one. This seems to have happened all of a sudden.
I have a repository on Bitbucket from where I pulled the initiate source files (this repository is created and maintained by me).
Any help is welcome. Thanks in advance. Do let me know if you need to see the gulp.config and gulpfile.js

i think its happening because of an npm package update where the version number was not bumped

It seems like there has an issue right now. You can follow the discussion below:
https://github.com/gulpjs/gulp/issues/1768

Related

Error - [trust-cert] TypeError: Cannot read property 'toString' of null

I am Building my first SharePoint client-side web part. I have used gulp trust-dev-cert and the output is coming with 2 errors. How to fix it?
C:\sharepoint>gulp trust-dev-cert
Build target: DEBUG
[12:50:19] Using gulpfile C:\sharepoint\gulpfile.js
[12:50:19] Starting gulp
[12:50:19] Starting 'trust-dev-cert'...
[12:50:19] Starting subtask 'configure-sp-build-rig'...
[12:50:19] Finished subtask 'configure-sp-build-rig' after 5.6 ms
[12:50:19] Starting subtask 'trust-cert'...
[12:50:22] Error - [trust-cert] TypeError: Cannot read property 'toString' of null
[12:50:22] Error - 'trust-cert' sub task errored after 2.59 s
Cannot read property 'toString' of null
[12:50:22] 'trust-dev-cert' errored after 2.93 s
[12:50:22]
[12:50:23] ==================[ Finished ]==================
Error - [trust-cert] TypeError: Cannot read property 'toString' of null
Error - 'trust-cert' sub task errored after 2.59 s
Cannot read property 'toString' of null
[12:50:23] Project sharepoint version:0.0.1
[12:50:23] Build tools version:3.12.1
[12:50:23] Node version:v10.23.0
[12:50:23] Total duration:8.05 s
[12:50:23] Task errors:2
This is the content in the folder
You will need to run gulp trust-dev-cert in the specific SPFX Solution folder, make sure the folder path "C:\sharepoint" is valid:

gulp trust-dev-cert without error, but access the page still failed

After I upgrade my Nodejs to v9.3.0 and NPM to 5.5.1, failed to access the gulp serve server. The browser show the unsafe TLS security error.
I have removed ~.gcb-serve-data/, and run the gulp trust-dev-cert without error, but I cannot find the cert in my trust certificates, I am working in Win10.
Following is the **gulp trust-dev-cert" output:
[18:30:14] Starting gulp
[18:30:14] Starting 'trust-dev-cert'...
[18:30:14] Starting subtask 'configure-sp-build-rig'...
[18:30:14] Finished subtask 'configure-sp-build-rig' after 7.48 ms
[18:30:14] Starting subtask 'trust-cert'...
[18:30:14] Finished subtask 'trust-cert' after 79 ms
[18:30:14] Finished 'trust-dev-cert' after 90 ms
[18:30:14] ==================[ Finished ]==================
gulp trust-dev-cert must be executed IN the project folder.

EPERM during gulp commands

I have a gulpfile that I am using together with Browserify, Babelify and BrowserSync to implement my build workflow. However, I am constantly having problems with EPERM errors in Node.js.
I first had an error in my gulp clean task that used rimraf in order to clean my dist directory. The task would occasionaly throw an error (I was not able to reproduce the error 100% of attempts though). The error was an EPERM that complained about the unlink action for ./dist/app.js. I tried using del instead of rimraf and for some reason it helped.
However, if I run gulp watch and something changes , there is very often this error now:
(node:10740) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
[22:52:35] Using gulpfile D:\Workspace\milestones\gulpfile.js
[22:52:35] Starting 'clean'...
[22:52:35] Finished 'clean' after 4.2 ms
[22:52:35] Starting 'build-persistent'...
[22:52:37] Finished 'build-persistent' after 1.55 s
[22:52:37] Starting 'watch'...
[22:52:37] Finished 'watch' after 92 ms
[BS] Local URL: http://localhost:3000
[BS] External URL: http://192.168.0.108:3000
[BS] Serving files from: ./
[22:52:48] Starting 'clean'...
[22:52:48] Finished 'clean' after 2.77 ms
[22:52:48] Starting 'build-persistent'...
stream.js:74
throw er; // Unhandled stream error in pipe.
^
Error: EPERM: operation not permitted, open 'D:\Workspace\milestones\dist\app.js'
at Error (native)
The full gulpfile may be seen in the gist here.
I am running Windows 10.
Update: The issue seems to be absent when running gulp build and therefore might be caused by BrowserSync.

Unable to run (gulp serve) Google Polymer Starter Kit v1.1.0 on Windows

I need help please!
I have been able to effortlessly install and run all previous versions of the PSK. I have spent hours now trying to get 1.1.0 to run in my environment. I have done everything I can think of. From googling the error to reviewing all current issues with this version here. Any of the suggested fixes dont work for me.
I have made no code changes and I am running CMD as the Admin.
When I grab a fresh copy of the repository and do the NPM & Bower installs, then run "gulp serve" I get the following error no matter what:
C:\FrontEnd\polymer-starter-kit>gulp serve
[09:45:33] Using gulpfile C:\FrontEnd\polymer-starter-kit\gulpfile.js
[09:45:33] Starting 'styles'...
[09:45:33] Starting 'elements'...
[09:45:33] Starting 'images'...
[09:45:33] Finished 'elements' after 249 ms
[09:45:33] styles all files 98 B
[09:45:33] Finished 'styles' after 590 ms
[09:45:34] images all files 35.41 kB
[09:45:34] Finished 'images' after 357 ms
[09:45:34] Starting 'serve'...
[09:45:34] Finished 'serve' after 73 ms
[PSK] Access URLs:
------------------------------------
Local: http://localhost:5000
External: http://xxx.xxx.x.x:5000
------------------------------------
UI: http://localhost:3001
UI External: http://xxx.xxx.x.x:3001
------------------------------------
[PSK] Serving files from: .tmp
[PSK] Serving files from: app
events.js:141
throw er; // Unhandled 'error' event
^
Error: spawn cmd ENOENT
at exports._errnoException (util.js:837:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
at onErrorNT (internal/child_process.js:344:16)
at doNTCallback2 (node.js:429:9)
at process._tickCallback (node.js:343:17)
My Environment:
All Required Prerequisites
Windows 10
Node.js v4.1.1
NPM v3.3.4
Bower v1.5.3
I am also not sure how to get a more detailed stack trace.
What should I do?
Thanks for the help!
It turns out I needed to add C:\Windows\System32 to my PATH vars. So strange. When I did that everything work like a charm.

Error in plugin 'gulp-notify': No reporter specified

I am trying to build a Sails.js and AngularJS app following this tutorial:
http://thoughtsmarkeddown.com/thoughts/javascript/setting-up-a-sails-js-with-angular-js-app-part-1/
I have setup my Sails App and angular App. Ater setting up the gulp file, which can be found here:
http://thoughtsmarkeddown.com/assets/Uploads/gulpfile.js
I ran the command gulp from my root folder and got the following error:
stream.js:94
throw er; // Unhandled stream error in pipe.
^
[gulp] Error in plugin 'gulp-notify': No reporter specified.
I have no idea how to debug this. This is my first AngularJS app. Was just trying to use it with Sails for eaiser and faster development. If I am doing it the wrong way, can you suggest me some place else I should read about how to make a AngularJS + Sails.js app.
Following is the full stack trace:
[11:22:30] Using gulpfile ~/Prophesee Media/PropheseeDashboard/gulpfile.js
[11:22:30] Starting 'sass'...
[11:22:30] Finished 'sass' after 7.93 ms
[11:22:30] Starting 'sailsbasejs'...
[11:22:30] Finished 'sailsbasejs' after 3.04 ms
[11:22:30] Starting 'angularappjs'...
[11:22:30] Finished 'angularappjs' after 1.26 ms
[11:22:30] Starting 'bowerjs'...
[11:22:30] Finished 'bowerjs' after 5.78 ms
[11:22:30] Starting 'angularviews'...
[11:22:30] Finished 'angularviews' after 446 μs
[11:22:30] Starting 'watch'...
[11:22:30] Finished 'watch' after 216 ms
[11:22:30] Starting 'default'...
[11:22:30] Finished 'default' after 5.71 μs
stream.js:94
throw er; // Unhandled stream error in pipe.
^
[gulp] Error in plugin 'gulp-notify': No reporter specified.
at report (/home/sambhav/Prophesee Media/PropheseeDashboard/node_modules/gulp- notify/index.js:70:34)
at Transform.notify [as _transform] (/home/sambhav/Prophesee Media/PropheseeDashboard/node_modules/gulp-notify/index.js:19:5)
at Transform._read (/home/sambhav/Prophesee Media/PropheseeDashboard/node_modules/gulp-notify/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:184:10)
at Transform._write (/home/sambhav/Prophesee Media/PropheseeDashboard/node_modules/gulp-notify/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:172:12)
at doWrite (/home/sambhav/Prophesee Media/PropheseeDashboard/node_modules/gulp-notify/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:238:10)
at writeOrBuffer (/home/sambhav/Prophesee Media/PropheseeDashboard/node_modules/gulp-notify/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:228:5)
at Transform.Writable.write (/home/sambhav/Prophesee Media/PropheseeDashboard/node_modules/gulp-notify/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:195:11)
at Stream.ondata (stream.js:51:26)
at Stream.EventEmitter.emit (events.js:95:17)
at queueData (/home/sambhav/Prophesee Media/PropheseeDashboard/node_modules/gulp/node_modules/vinyl-fs/node_modules/map-stream/index.js:43:21)
What version of gulp-notify you are using? We had a similar issue on a CI-system on a linux machine (see this issue). To solve this we've updated gulp-notify to the actual version 1.3.1.
To update your dev-dependencies you must remove the actual version first and install it again. It's a known bug from npm that you cannot use npm update on dev-dependencies. So what do I do?
# remove
npm rm --save-dev gulp-notify
# install again
npm install --save-dev gulp-notify
May it's helpful for you.
Ciao
Ralf
It's a known issue:
https://github.com/webcomm/magento-boilerplate/issues/32
solution:
update gulp to 3.5.6
"devDependencies": {
"gulp": "~3.5.6",
}
Try below command :
npm install --save gulp-notify //use save this will save the dependencies in package.json
Hope this will work!!

Resources