Hi,
I see problems when running through these steps.
When node seed is run it fails with following error.
$ node seed
Error: Cannot find module '…/rev-manifest’
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Function._load (/home/manish/FreeCodeCamp/FreeCodeCamp/node_modules/pmx/lib/transaction.js:62:21)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object. (/home/manish/FreeCodeCamp/FreeCodeCamp/server/middlewares/jade-helpers.js:1:1)
at Module._compile (module.js:571:32)
at loader (/home/manish/FreeCodeCamp/FreeCodeCamp/node_modules/babel-register/lib/node.js:144:5)
at Object.require.extensions.(anonymous function) [as .js] (/home/manish/FreeCodeCamp/FreeCodeCamp/node_modules/babel-register/lib/node.js:154:7)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Function._load (/home/manish/FreeCodeCamp/FreeCodeCamp/node_modules/pmx/lib/transaction.js:62:21)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at /home/manish/FreeCodeCamp/FreeCodeCamp/node_modules/loopback-boot/lib/executor.js:343:19
I tried installing rev-manifest module but it did not help.
Thanks,
Manish
$ touch server/rev-manifest.json
$ echo ‘{}’ >> server/rev-manifest.json
were the steps needed to be performed.
-Manish
Thanks for the info Manish! I updated the guide to include the script that does that for you.
I had to run the npm commands in the free code camp directory. Is that obvious? (I’ve never used node.js before. It took me a while to figure that out.)
Thanks - I’ll update this to clarify this.
Does it matter which 2.7 Python is installed - the 32 bit or 64 bit ? Usually install software that matches the OS, but read that 32 bit python is preferred regardless of your OS because 64 bit version might not work with certain python libraries. Wanted to check if it mattered for the FCC build.
how can i Set up your private environment variables (API Keys)?
When I run this command 'npm run only-once. ’ i get the following error: “Error: Connection strategy not found”
Hi all! I have updated the wiki to resolve the problems you had.
@seahik I’m not sure. I haven’t heard about any problems with the wrong version of Python.
@dhrey112 You should only have to copy the sample.env
file to a new .env
file for that. I have updated the wiki to avoid confusion about this in the future.
@netstudenton It sounds like you missed the step of copying the sample.env
file to a new .env
file, or it went wrong. Previously, it was step 5 of the first list. I have now made it step 3 of the second list. Hopefully the change makes it easier to follow along.
Mine says “[thread1] waiting for connections on port 27017” - it does not allow commands to be typed.at this point.
Edit: perhaps you meant “start a new shell, change to the directory where the freeCodeCamp repo is located and run npm run only-once
.” But when I did that, it did not cause any additional output in the window where I started mongod
. I’m not sure if this is the expected output:
C:\Dev\freeCodeCamp>npm run only-once
> freecodecamp@0.1.0 only-once C:\Dev\freeCodeCamp
> npm run create-rev && echo '
seeding database
' && node seed && echo '
Seeding Completed
'
> freecodecamp@0.1.0 create-rev C:\Dev\freeCodeCamp
> node -e "var fs = require('fs'); fs.access('./server/rev-manifest.json', function(err) { if (err) { c
onsole.log('\n\ncreating manifest\n\n'); return fs.writeFileSync('server/rev-manifest.json', '{}'); } c
onsole.log('\n\nrev-manifest present\n\n'); });"
creating manifest
'
Well, the site seemed to start locally, but how to log in? I decided to try the “Sign Up” link to create an account. When I tried to sign up, {}
appeared in the browser window and the site crashed:
200 GET 367.425 ms - /en/vendor-main.js
loopback deprecated loopback#context middleware is deprecated. See https://docs.strongloop.com/display/
APIC/Using%20current%20context for more details. node_modules\loopback\server\middleware\rest.js:60:32
fcc:user:remote checking existence +24s
fcc:user:remote where { email: 'qwertie256@gmail.com' } +1ms
fcc:user:remote user created, sending email +86ms
200 POST 380.793 ms - /api/users
Error: Callback was already called.
at C:\Dev\freeCodeCamp\node_modules\async\dist\async.js:903:32
at C:\Dev\freeCodeCamp\node_modules\async\dist\async.js:3835:13
at interceptInvocationErrors (C:\Dev\freeCodeCamp\node_modules\strong-remoting\lib\remote-objects.js:690:22)
at C:\Dev\freeCodeCamp\node_modules\loopback-phase\node_modules\async\lib\async.js:154:25
at C:\Dev\freeCodeCamp\node_modules\loopback-phase\node_modules\async\lib\async.js:154:25
at C:\Dev\freeCodeCamp\node_modules\loopback-phase\node_modules\async\lib\async.js:154:25
at C:\Dev\freeCodeCamp\node_modules\strong-remoting\lib\remote-objects.js:656:7
at C:\Dev\freeCodeCamp\node_modules\strong-remoting\lib\http-context.js:397:7
at callback (C:\Dev\freeCodeCamp\node_modules\strong-remoting\lib\shared-method.js:253:5)
at C:\Dev\freeCodeCamp\node_modules\loopback-datasource-juggler\lib\dao.js:381:19
at doNotify (C:\Dev\freeCodeCamp\node_modules\loopback-datasource-juggler\lib\observer.js:99:49)
at C:\Dev\freeCodeCamp\node_modules\loopback-datasource-juggler\lib\observer.js:112:23
at C:\Dev\freeCodeCamp\node_modules\loopback-datasource-juggler\node_modules\async\lib\async.js:189:25
at invalidateOtherTokens (C:\Dev\freeCodeCamp\node_modules\loopback\common\models\user.js:920:38)
at notifySingleObserver (C:\Dev\freeCodeCamp\node_modules\loopback-datasource-juggler\lib\observer.js:104:22)
at iterate (C:\Dev\freeCodeCamp\node_modules\loopback-datasource-juggler\node_modules\async\lib\async.js:181:13)
at Object.async.eachSeries (C:\Dev\freeCodeCamp\node_modules\loopback-datasource-juggler\node_modules\async\lib\async.js:197:9)
at doNotify (C:\Dev\freeCodeCamp\node_modules\loopback-datasource-juggler\lib\observer.js:101:11)
at doNotify (C:\Dev\freeCodeCamp\node_modules\loopback-datasource-juggler\lib\observer.js:99:49)
at doNotify (C:\Dev\freeCodeCamp\node_modules\loopback-datasource-juggler\lib\observer.js:99:49)
at doNotify (C:\Dev\freeCodeCamp\node_modules\loopback-datasource-juggler\lib\observer.js:99:49)
at Function.ObserverMixin._notifyBaseObservers (C:\Dev\freeCodeCamp\node_modules\loopback-datasource-juggler\lib\observer.js:122:5)
[06:09:00] [nodemon] app crashed - waiting for file changes before starting...
I get the following code when I ran gulp on the freecodescamp folder
/home/kofi/Desktop/freeCodeCamp-staging/gulpfile.js:171
function errorHandler(…args) {
^^^
SyntaxError: Unexpected token …
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
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 Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Liftoff.handleArguments (/usr/local/lib/node_modules/gulp/bin/gulp.js:116:3)
at Liftoff. (/usr/local/lib/node_modules/gulp/node_modules/liftoff/index.js:198:16)
at module.exports (/usr/local/lib/node_modules/gulp/node_modules/flagged-respawn/index.js:17:3)
Hi @kofimokome!
I believe I replied to you on Gitter as well. This sounds like a problem with an outdated version of Node.js
freeCodeCamp requires at least version 6. You can check which version you’re running with the following command: node -v
You can follow the link in the article at the top and run the installer to update. You might need to restart after installation to get things to work.
Hi,
Please update path to have quotes around them in step 5, where we are creating a shortcut to mongodb executable on Windows.
The %programfiles% environment variable returns path without escaping spaces and this throws an error in cmd. “%programfiles%\MongoDB\Server\3.0\bin\mongod.exe” worked for me. Also please hint to substitute installed mongodb version in place of 3.0.
Thanks,
Narveer
@narveersingh That’s a good idea! I updated the wiki, can you check if it’s OK this way?
I get this error everytime i type the commands in cmd
npm install gulp -g
npm ERR! Windows_NT 10.0.10240
npm ERR! argv “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js” “install” “gulp” “-g”
npm ERR! node v7.9.0
npm ERR! npm v4.2.0
npm ERR! file C:\Users\EMMANUEL\AppData\Roaming\npm-cache\deprecated\0.0.1\package\package.json
npm ERR! code EJSONPARSE
npm ERR! Failed to parse json
npm ERR! Unexpected token ‘\u0000’ at 1:1
npm ERR!
npm ERR! ^
npm ERR! File: C:\Users\EMMANUEL\AppData\Roaming\npm-cache\deprecated\0.0.1\package\package.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR!
npm ERR! This is not a bug in npm.
npm ERR! Tell the package author to fix their package.json file. JSON.parse
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\EMMANUEL\AppData\Roaming\npm-cache_logs\2017-07-09T01_04_48_781Z-debug.log
C:\WINDOWS\system32>npm install node-gyp -g
npm ERR! Windows_NT 10.0.10240
npm ERR! argv “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js” “install” “node-gyp” “-g”
npm ERR! node v7.9.0
npm ERR! npm v4.2.0
npm ERR! file C:\Users\EMMANUEL\AppData\Roaming\npm-cache\mkdirp\0.5.1\package\package.json
npm ERR! code EJSONPARSE
npm ERR! Failed to parse json
npm ERR! Unexpected token ‘\u0000’ at 1:1
npm ERR!
npm ERR! ^
npm ERR! File: C:\Users\EMMANUEL\AppData\Roaming\npm-cache\mkdirp\0.5.1\package\package.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR!
npm ERR! This is not a bug in npm.
npm ERR! Tell the package author to fix their package.json file. JSON.parse
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\EMMANUEL\AppData\Roaming\npm-cache_logs\2017-07-09T01_05_17_527Z-debug.log
Hi @MORONFOLUWA!
I’ve never seen that error before. A google search suggests that this happens because the npm cache got corrupted. It should be fixed by running npm cache clean
Can you try that and let me know if it works?
I got it working! Thanks for this guide.
Here is my setup:
Windows 10
Python 3.6.0 but I also have Python 2.7 but 3.6 is the one on my PATH
Node 6.10.0
npm 3.10.10
MongoDB 3.2.10
On step 5 I got an error, but this answer helped me resolved it by changing the port of mongo, and on the .env file. And also on step 3 its copy
not cp
as the guide is for windows pc .
Also I’m getting this error, after sign up, but then I am able to sign in with the account I just signed. Anyway I tried it and I think it’s working fine.
Thankyou! I found this guide very helpful