You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue-429. @drew-gross Hi, That issue was concluded as future fix in 2.1.0, but even after using 2.1.3 i am facing the same issue. I am using the following index.js file.
// Example express application adding the parse-server module to expose Parse
// compatible API routes.
var express = require('express');
var ParseServer = require('parse-server').ParseServer;
var databaseUri = process.env.DATABASE_URI || process.env.MONGOLAB_URI;
if (!databaseUri) {
console.log('DATABASE_URI not specified, falling back to localhost.');
}
var api = new ParseServer({
databaseURI: databaseUri || '<my_db_uri>',
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
appId: process.env.APP_ID || '<my_app_id>',
masterKey: process.env.MASTER_KEY || '<my_master_key>', //Add your master key here. Keep it secret!
serverURL: process.env.SERVER_URL || 'http://localhost:1337', // Don't forget to change to https if needed
fileKey: '<my_file_key>'
});
// Client-keys like the javascript key or the .NET key are not necessary with parse-server
// If you wish you require them, you can set them as options in the initialization above:
// javascriptKey, restAPIKey, dotNetKey, clientKey
var app = express();
// Serve the Parse API on the /parse URL prefix
var mountPath = process.env.PARSE_MOUNT || '/parse';
app.use(mountPath, api);
// Parse Server plays nicely with the rest of your web routes
app.get('/', function(req, res) {
res.status(200).send('I dream of being a web site.');
});
var port = process.env.PORT || 1337;
app.listen(port, function() {
console.log('parse-server-example running on port ' + port + '.');
});
And upon npm start i get the following error
Error: Cannot find module 'parse-server' at Function.Module._resolveFilename (module.js:326:15) at Function.Module._load (module.js:277:25) at Module.require (module.js:354:17) at require (internal/module.js:12:17) at Object.<anonymous> (D:\RND\node\parse\parse-server\index.js:5:19) 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)
Further info for this issue - I have had to fork the repo, clone it on my laptop, run npm install which then builds the repo properly, then I change .gitignore to remove lib from the excluded list. After pushing the changes, I now get the lib folder on my forked repo, which I then add to my server's package.json (instead of the original).
Can you help us understand why the repo must be built from src onto lib? I'm not familiar with this flow.
@dozzman all of those have been merged, we're at version 2.1.6 now.
If you wanna have parse-server running on master this is what I recommend:
## Assuming your project is initialized with a git repository
## and npm
# clone parse-server
git submodule add https://github.com/parseplatform/parse-server
# link parse-server to use the repo instead of the package
npm link parse-server ./parse-server
# commit and push
git add add -A
git commit -am 'Adds parse-server as submodule'
# if you're on heroku
git push heroku master
@flovilmart thanks a lot, it worked that way. I first did the check out of parse-server-example and than added parse-server from master branch as sub-module and linked it.
Sorry but i have to ask this as i am new to nodeJS and GIT and all, what i wanted to know is that i am using parse server directly from master branch in this parse-server-example. The current version of that parse-server is 2.2.0 in my repo, So how to update that repo using npm? Do i have to execute this npm install -g npm-check-updates from the root of parse-server-example ?
Activity
omairvaiyani commentedon Feb 28, 2016
Further info for this issue - I have had to fork the repo, clone it on my laptop, run
npm installwhich then builds the repo properly, then I change.gitignoreto removelibfrom the excluded list. After pushing the changes, I now get thelibfolder on my forked repo, which I then add to my server's package.json (instead of the original).Can you help us understand why the repo must be built from
srcontolib? I'm not familiar with this flow.drew-gross commentedon Feb 28, 2016
We made some changes in how the library gets built in 2.1.3. I guess some issues snuck in. We'll make sure they are fixed in the next version.
dozzman commentedon Mar 8, 2016
Any update on when we might see a fix?
I'm currently blocked by #852 but I can't seem to grab the #857 fix without going round the houses due to this problem.
Cheers.
flovilmart commentedon Mar 12, 2016
@dozzman all of those have been merged, we're at version 2.1.6 now.
If you wanna have parse-server running on master this is what I recommend:
KunalKathrotia commentedon Mar 23, 2016
@flovilmart thanks a lot, it worked that way. I first did the check out of
parse-server-exampleand than addedparse-serverfrom master branch as sub-module and linked it.Sorry but i have to ask this as i am new to nodeJS and GIT and all, what i wanted to know is that i am using parse server directly from master branch in this parse-server-example. The current version of that parse-server is 2.2.0 in my repo, So how to update that repo using npm? Do i have to execute this
npm install -g npm-check-updatesfrom the root of parse-server-example ?