_.any is not a function
See original GitHub issueIssue 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
- Grab the latest version of Ghost from Ghost.org:
$ curl -L https://ghost.org/zip/ghost-latest.zip -o ghost.zip
- 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)
-
Move to the new ghost directory, and install Ghost (production dependencies only):
$ cd /var/www/ghost && npm install --production
-
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:
- Created 7 years ago
- Comments:7 (2 by maintainers)
Top GitHub Comments
Hey @kthornsbury and @EwanValentine, sorry to hear you are having trouble. Could you try deleting your
node_modules
directory and runningnpm install --production
again? It sounds likenpm
hasn’t installed correctly, unfortunately it has issues quite often that result in these sorts of issues 😞 You may need also need to runnpm cache clear
first.Looks like if I run the following commands, everything works as expected: