Gatsby: Error: Cannot find module 'netlify-cms-app/dist/netlify-cms-app.js'

Created on 21 Feb 2020  路  3Comments  路  Source: gatsbyjs/gatsby

Description

I was trying to use gatsby-plugin-netlify-cms and facing this particular error on gatsby build , but runs fine on gatsby develop.

Steps to reproduce

setup a new blog using https://github.com/gatsbyjs/gatsby-starter-blog
added netlify plugin and setup a few details regarding the same
How to Make a Minimal Reproduction: https://www.github.com/shauryak3/shauryakalia.com

Expected result

Should run without errors

Actual result

ERROR #11321 PLUGIN

"gatsby-plugin-netlify-cms" threw an error while running the onCreateWebpackConfig lifecycle:

Cannot find module 'netlify-cms-app/dist/netlify-cms-app.js'

251 | assetDir = _ref7.assetDir;
252 | return [{

253 | from: require.resolve(_path.default.join(name, assetDir, assetName)),
| ^
254 | to: assetName
255 | }, sourceMap && {
256 | from: require.resolve(_path.default.join(name, assetDir, sourceMap)),

File: node_modules/gatsby-plugin-netlify-cms/gatsby-node.js:253:23

Error: Cannot find module 'netlify-cms-app/dist/netlify-cms-app.js'

Environment

System:
OS: macOS Mojave 10.14.6
CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
Shell: 5.3 - /bin/zsh
Binaries:
Node: 10.16.0 - /usr/local/bin/node
Yarn: 1.21.1 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
Languages:
Python: 2.7.16 - /usr/bin/python
Browsers:
Chrome: 80.0.3987.116
Safari: 13.0.5
npmPackages:
gatsby: ^2.19.7 => 2.19.7
gatsby-image: ^2.2.39 => 2.2.39
gatsby-plugin-feed: ^2.3.26 => 2.3.26
gatsby-plugin-google-analytics: ^2.1.34 => 2.1.34
gatsby-plugin-manifest: ^2.2.39 => 2.2.39
gatsby-plugin-netlify-cms: ^4.1.40 => 4.1.40
gatsby-plugin-offline: ^3.0.32 => 3.0.32
gatsby-plugin-react-helmet: ^3.1.21 => 3.1.21
gatsby-plugin-sharp: ^2.4.3 => 2.4.3
gatsby-plugin-typography: ^2.3.21 => 2.3.21
gatsby-remark-copy-linked-files: ^2.1.36 => 2.1.36
gatsby-remark-images: ^3.1.42 => 3.1.42
gatsby-remark-prismjs: ^3.3.30 => 3.3.30
gatsby-remark-responsive-iframe: ^2.2.31 => 2.2.31
gatsby-remark-smartypants: ^2.1.20 => 2.1.20
gatsby-source-filesystem: ^2.1.46 => 2.1.46
gatsby-transformer-remark: ^2.6.48 => 2.6.48
gatsby-transformer-sharp: ^2.3.13 => 2.3.13
npmGlobalPackages:
gatsby-cli: 2.8.29

needs reproduction

Most helpful comment

You were missing the required dependency netlify-cms-app as shown here: https://www.gatsbyjs.org/docs/sourcing-from-netlify-cms/

If you install that your project will work.

We're marking this issue as answered and closing it for now but please feel free to comment here if you would like to continue this discussion. We also recommend heading over to our communities if you have questions that are not bug reports or feature requests. We hope we managed to help and thank you for using Gatsby!

All 3 comments

Hi!

Sorry to hear you're running into an issue. To help us best begin debugging the underlying cause, it is incredibly helpful if you're able to create a minimal reproduction. This is a simplified example of the issue that makes it clear and obvious what the issue is and how we can begin to debug it.

If you're up for it, we'd very much appreciate if you could provide a minimal reproduction and we'll be able to take another look.

Thanks for using Gatsby! 馃挏

Hi @LekoArts ,

I have mentioned a minimal reproduction repo above
How to Make a Minimal Reproduction: https://www.github.com/shauryak3/shauryakalia.com.
It includes setting up a new project by : gatsby new repo-name https://github.com/gatsbyjs/gatsby-starter-blog
and then setting up the netlify-cms plugin.
Thanks.

You were missing the required dependency netlify-cms-app as shown here: https://www.gatsbyjs.org/docs/sourcing-from-netlify-cms/

If you install that your project will work.

We're marking this issue as answered and closing it for now but please feel free to comment here if you would like to continue this discussion. We also recommend heading over to our communities if you have questions that are not bug reports or feature requests. We hope we managed to help and thank you for using Gatsby!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dustinhorton picture dustinhorton  路  3Comments

kalinchernev picture kalinchernev  路  3Comments

ghost picture ghost  路  3Comments

brandonmp picture brandonmp  路  3Comments

signalwerk picture signalwerk  路  3Comments