question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

_.any is not a function

See original GitHub issue

Issue Summary

I just followed the installation instructions to get a new instance of Ghost running on an Ubuntu server. I can get the server started, but once I create an account and go to create a post, I see an alert at the top of the screen which reads “_.any is not a function” and the following error stack is shown in the terminal where I ran “npm start --production”:

ERROR: _.any is not a function 
 
 TypeError: _.any is not a function
    at Object.findStatement (/var/www/ghost/node_modules/ghost-gql/lib/lodash-stmt.js:84:14)
    at /var/www/ghost/core/server/models/plugins/filter.js:53:33
    at /var/www/ghost/node_modules/ghost-gql/lib/lodash-stmt.js:119:22
    at /var/www/ghost/node_modules/lodash/lodash.js:10541:37
    at arrayFilter (/var/www/ghost/node_modules/lodash/lodash.js:588:11)
    at Function.reject (/var/www/ghost/node_modules/lodash/lodash.js:9700:14)
    at Object.rejectStatements (/var/www/ghost/node_modules/ghost-gql/lib/lodash-stmt.js:112:14)
    at Object.combineFilters (/var/www/ghost/core/server/models/plugins/filter.js:52:44)
    at fetchAndCombineFilters (/var/www/ghost/core/server/models/plugins/filter.js:132:41)
    at applyDefaultAndCustomFilters (/var/www/ghost/core/server/models/plugins/filter.js:154:22)
    at Function.findPage (/var/www/ghost/core/server/models/base/index.js:343:24)
    at modelQuery (/var/www/ghost/core/server/api/posts.js:58:38)
    at runTask (/var/www/ghost/core/server/utils/pipeline.js:16:24)
    at /var/www/ghost/core/server/utils/pipeline.js:26:20
    at tryCatcher (/var/www/ghost/node_modules/bluebird/js/release/util.js:16:23)
    at Object.gotValue (/var/www/ghost/node_modules/bluebird/js/release/reduce.js:157:18)  

Steps to Reproduce

  1. Grab the latest version of Ghost from Ghost.org: $ curl -L https://ghost.org/zip/ghost-latest.zip -o ghost.zip
  2. Unzip Ghost into the folder /var/www/ghost (recommended install location):

$ unzip -uo ghost.zip -d /var/www/ghost

Note: You may additionally need to create the /var/www/ directory with the command mkdir /var/www/, or install the unzip package following the instructions for your linux distro)

  1. Move to the new ghost directory, and install Ghost (production dependencies only): $ cd /var/www/ghost && npm install --production

  2. Start the server in production mode $ npm start --production

Technical details:

  • Ghost Version: 0.11.3
  • Node Version: 4.2.0
  • Browser/OS: Ubuntu 14.04 LTS
  • Database: SQLite3

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
kevinansfieldcommented, Dec 24, 2016

Hey @kthornsbury and @EwanValentine, sorry to hear you are having trouble. Could you try deleting your node_modules directory and running npm install --production again? It sounds like npm hasn’t installed correctly, unfortunately it has issues quite often that result in these sorts of issues 😞 You may need also need to run npm cache clear first.

0reactions
kthornsburycommented, Jan 3, 2017

Looks like if I run the following commands, everything works as expected:

rm -rf node_modules/

npm cache clear

npm install --production

npm install --save amperize@0.3.1 archiver@1.1.0 bcryptjs@2.3.0 bluebird@3.4.6 body-parser@1.15.2 bookshelf@0.10.2 chalk@1.1.3 cheerio@0.22.0 compression@1.6.2 connect-slashes@1.3.1 cookie-session@1.2.0 cors@2.8.1 csv-parser@1.11.0 downsize@0.0.8 express@4.14.0 express-hbs@1.0.3 extract-zip-fork@1.5.1 fs-extra@0.30.0 ghost-gql@0.0.5 glob@5.0.15 gscan@0.0.15 html-to-text@2.1.3 image-size@0.5.0 intl@1.2.5 intl-messageformat@1.3.0 jsonpath@0.2.7 knex@0.12.5 lodash@^4.17.2 moment@2.15.2 morgan@1.7.0 multer@1.2.0 netjet@1.1.3 node-uuid@1.4.7 nodemailer@0.7.1 oauth2orize@1.5.1 passport@0.3.2 passport-http-bearer@1.0.1 passport-oauth2-client-password@0.1.2 path-match@1.2.4 rss@1.2.1 sanitize-html@1.13.0 semver@5.3.0 showdown-ghost@0.3.6 superagent@2.3.0 unidecode@0.1.8 validator@5.7.0 xml@1.0.1 sqlite3@https://registry.npmjs.org/sqlite3/-/sqlite3-3.1.8.tgz
Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: "x" is not a function - JavaScript - MDN Web Docs
The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value...
Read more >
Why is .every() not a function? - Stack Overflow
I've gathered an Array (I think) of required form elements... No, it's just jQuery object. jQuery objects are very array-like, but they aren't ......
Read more >
How to solve every is not a function in JavaScript - Reactgo
The “every is not a function” error occurs, when we call a every() method on a value which is not array. To fix...
Read more >
How to Handle JavaScript Uncaught TypeError: “x” is Not a ...
The Javascript error TypeError: "x" is not a function occurs when there is an attempt to call a function on a value or...
Read more >
Promise.any is not a function? - help - Meteor forums
I just want to retrieve the returned value of the first one to fulfill. However, I'm getting an error saying “Promise.any is not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found