React-Starterify Project on Windows computer, babel not working - node.js

I've just recently started to learn how to use the React framework and have been following the LevelUpTuts channel on youtube. In video 7 of their React playlist, they use this (I guess boilerplate) project called React-Starterify. He made it look easy installing it on his Mac, however I'm on windows and it is becoming a complete nightmare. Here is the project:
https://github.com/Granze/react-starterify
I've followed the exact steps, however when I do the whole "npm run watch".
> react-starterify#2.1.3 watch K:\IT Projects\ReactTutes\MailingList\react-starterify-2.1.4
> gulp watch
[13:40:11] Requiring external module babel-core/register
K:\IT Projects\ReactTutes\MailingList\react-starterify-2.1.4\gulpfile.babel.js:108
var opts = Object.assign({}, _watchify2.default.args, customOpts);
^
TypeError: undefined is not a function
at Object.<anonymous> (gulpfile.babel.js:39:21)
at Module._compile (module.js:460:26)
at loader (K:\IT Projects\ReactTutes\MailingList\react-starterify-2.1.4\node_modules\babel-core\node_modules\babel-register\lib\node.js:130:5)
at Object.require.extensions.(anonymous function) [as .js] (K:\IT Projects\ReactTutes\MailingList\react-starterify-2.1.4\node_modules\babe
l-core\node_modules\babel-register\lib\node.js:140:7)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Liftoff.handleArguments (K:\IT Projects\ReactTutes\MailingList\react-starterify-2.1.4\node_modules\gulp\bin\gulp.js:116:3)
at Liftoff.<anonymous> (K:\IT Projects\ReactTutes\MailingList\react-starterify-2.1.4\node_modules\gulp\node_modules\liftoff\index.js:192:16)
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "watch"
npm ERR! node v0.12.2
npm ERR! npm v2.7.4
npm ERR! code ELIFECYCLE
npm ERR! react-starterify#2.1.3 watch: `gulp watch`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-starterify#2.1.3 watch script 'gulp watch'.
npm ERR! This is most likely a problem with the react-starterify package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! gulp watch
npm ERR! You can get their info via:
npm ERR! npm owner ls react-starterify
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! K:\IT Projects\ReactTutes\MailingList\react-starterify-2.1.4\npm-debug.log
I've tried updating gulp and babel, with the same results.
Gulp CLI and Local versions are 3.9.0.
I looks like it's complaining about something with Windows. Has anyone had any luck getting their Windows machine working with the project?
If not, can anyone recomment another starter project for React, for beginners?

I haven't used react-starterify, but I have used a site called http://www.overreact.io/ It allows you to draw out your components and then download all of your starter files including a server/gulp. I know for windows you would have to download the zip file, since the npm package doesn't work at the moment, but I have used the zip and it works. Hope that helps!

Related

I get these errors when I use the ```npm run dev``` command

Error: Cannot find module 'This is the Folder path \bin\webpack.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
at Function.Module._load (internal/modules/cjs/loader.js:745:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
at internal/main/run_main_module.js:17:47* {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # dev: `webpack serve --config ./bundler/webpack.dev.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\21697\AppData\Roaming\npm-cache\_logs\2021-09-20T20_54_58_070Z-debug.log
PS C:This is the Folder path>
PS: I did delete both the package-lock & node_modules and reinstalled npm using npm install
but the problem still exists, I also tried reinstalling node js, same thing
Error: Cannot find module 'This is the Folder path \bin\webpack.js'
It's looking for a module with name/path 'This is the Folder path \bin\webpack.js'. That doesn't look like a valid module name/path.
Looks like you added some debug text somewhere you shouldn't have.
Hard to come up with other explanations since you did not post any of the code.
I finally solved it by reinstalling both node js & npm and instlalling chokidar 3 using the command npm i chokidar#3.0.0 it turns out that the previous version does not support node js 14+

Puppetter fails due to node modules error

I am new to puppeteer and would appreciate as much help as possible.
My puppeteer tests build fails in travis ci. I am assuming the reason may be related to puppeteer's node_module. Any suggestion would be helpful.
There have been similar issues logged but with no solution provided. Here are some links of these issues:
https://github.com/GoogleChrome/puppeteer/issues/833
https://api.travis-ci.com/v3/job/124937719/log.txt
https://travis-ci.com/BME-MIT-IET/Hmmm-iet-2018/jobs/124938746
My system config:
Puppeteer version:1.8.0
Platform / OS version: Mac > High Sierra
Node.js version: v8.12.0
npm : 6.4.1
This is the error message:
puppeteer#1.8.0 install /www/vhosts//node_modules/puppeteer
node install.js
/www/vhosts/node_modules/puppeteer/install.js:61
.then(() => browserFetcher.localRevisions())
^
SyntaxError: Unexpected token )
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:935:3
npm ERR! puppeteer#1.8.0 install: node install.js
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the puppeteer#1.8.0 install script 'node install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the puppeteer package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs puppeteer
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls puppeteer
npm ERR! There is likely additional logging output above.
From the Puppeteer documentation:
Puppeteer requires at least Node v6.4.0, but the examples below use async/await which is only supported in Node v7.6.0 or greater.
Your Travis configuration uses node v0.10.42 so you must upgrade it to atleast v6.4.0.
You can reference to Travis documentation on Specifying Node.js versions. Here is a minimal setup:
.travis.yml:
language: node_js
node_js:
- "iojs"
- "7"

Deploying a meteor 1.2 app to Ubuntu 16.04

I have an app that is still at meteor 1.2 that I used to deploy to ubuntu 14.04 servers happily with mup. However, I have now moved the host server along to 16.04 and mup (as well as mupc) have stopped working.
The last time I deployed one of these apps I followed the procedure below and it worked fine.
apt install nodejs nodejs-legacy
install nvm
nvm install v0.10.40
Bundle the app on my dev box, and unpack it on the host
cd /app/programs/server
npm install
and I get
> fibers#1.0.5 install /opt/sapwfdashboard/programs/server/node_modules/fibers
> node ./build.js
(node) child_process: options.customFds option is deprecated. Use options.stdio instead.
internal/child_process.js:298
throw errnoException(err, 'spawn');
^
Error: spawn EACCES
at exports._errnoException (util.js:870:11)
at ChildProcess.spawn (internal/child_process.js:298:11)
at Object.exports.spawn (child_process.js:362:9)
at build (/opt/sapwfdashboard/programs/server/node_modules/fibers/build.js:55:5)
at Object.<anonymous> (/opt/sapwfdashboard/programs/server/node_modules/fibers/build.js:47:3)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:442:10)
npm ERR! fibers#1.0.5 install: `node ./build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the fibers#1.0.5 install script.
npm ERR! This is most likely a problem with the fibers package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./build.js
npm ERR! You can get their info via:
npm ERR! npm owner ls fibers
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.4.0-109-generic
npm ERR! command "/root/.nvm/v0.10.40/bin/node" "/root/.nvm/v0.10.40/bin/npm" "install"
npm ERR! cwd /opt/sapwfdashboard/programs/server
npm ERR! node -v v0.10.40
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
I'm stuck. Any idea how to get around this. I am going to have to upgrade this app as the initial deployments are just impossible now.
The best way I've found to deploy this is to use mupc to set up the instances, and then use the manual deployment process from there onwards.
I'm still to work out what the differences are.

Google Firebase functions ImageMagick thumbnail creation failing

I am working on google firebase functions to generate thumbnails for images using imagemagic, I did exactly what is mentioned in this link
and also I have gone through this link.
I am getting the following exception while deploying using gcloud app deploy command. I have gone through other SO posts(link) which are similar to this issue.
I also have updated firebase tools using (npm install -g firebase-tools). is anything else I am missing ?
In the exception is says
at Object. (/app/lib/functions.js:43:47) at line number 43 the code snippet looks like this
exports.generateThumbnail = functions.storage.object().onChange(event => {
Exception looks as follows
Updating service [default]...failed.
ERROR: (gcloud.app.deploy) Error Response: [9]
Application startup error:
> nodejs-getting-started#1.0.0 start /app
> node app.js
/app/node_modules/firebase-functions/lib/config.js:51
throw new Error('Firebase config variables are not available. ' +
^
Error: Firebase config variables are not available. Please use the latest version of the Firebase CLI to deploy this function.
at init (/app/node_modules/firebase-functions/lib/config.js:51:15)
at Object.config (/app/node_modules/firebase-functions/lib/config.js:29:9)
at Object.object (/app/node_modules/firebase-functions/lib/providers/storage.js:41:27)
at Object.<anonymous> (/app/lib/functions.js:43:47)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
npm ERR! Linux 3.16.0-4-amd64
npm ERR! argv "/nodejs/bin/node" "/nodejs/bin/npm" "start"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! nodejs-getting-started#1.0.0 start: `node app.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nodejs-getting-started#1.0.0 start script 'node app.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the nodejs-getting-started package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node app.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs nodejs-getting-started
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls nodejs-getting-started
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /app/npm-debug.log

npm install: Error : Cannot find module 'tough-cookie'

I have removed and reinstalled node.js many times
> node -v
4.5.0
> npm -v
3.3.6
Once I run the command npm install request I get the following error :
Error: Cannot find module 'tough-cookie'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (C:\Users\Generic User\AppData\Roaming\npm\node_modules\npm\node_modules\request\lib\cookies.js:3:13)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Generic User\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "request"
npm ERR! node v4.5.0
npm ERR! npm v3.3.6
npm ERR! code MODULE_NOT_FOUND
npm ERR! Cannot find module 'tough-cookie'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
You probably will tell me to run
> npm update -g npm
I get the same error for this command too.
It looks like your version 3 npm install is broken, for some reason. It'd be interesting to know whether this path exists:
C:\Users\Generic User\AppData\Roaming\npm\node_modules\npm\node_modules\request\node_modules\tough-cookie
and whether it contains a valid package, etc.
With your npm v 3 install, broken, none of the npm install or update commands will work (as they'll need the request module). However, you might be able to roll back npm - as version 4.5.0 of Node.js installs npm version 2.15.9 and it will still be there:
> npm uninstall -g npm
That should leave you with:
> npm -v
2.15.9
Before re-installing npm v 3, clear the cache:
> npm cache clear
> npm install -g npm
However, before you re-install version npm v 3, it would be interesting to see if you are able to install request with npm v 2.
In my case it was a .lock file that caused this error, deleting the file fixed it. Same problem and solution was reported here: https://github.com/sass/node-sass/issues/2019
Is there a package.json file in the folder you are running node from?
If there is a package.json, then running :
npm install request
will not have the desired effect, in fact npm will just try and install whatever module is described in package.json
Have you tried npm install tough-cookie
it has worked for me
its browser issue ... please try to open it in chrome incognito windows or firefox private window and delete cookies

Resources