Home > other >  new gatsby project is not running
new gatsby project is not running

Time:03-06

I've created new gatsby project. After successful installation, I tried to run it with command npm run develop and gatsby develop but it is throwing error. Unable to figure out the root cause of error. I tried re installing node_modules but nothing is working! Please Help! Thank you!

ERROR:

D:\FC\gatsby-shopify-site>npm run develop

> [email protected] develop
> gatsby develop

D:\FC\gatsby-shopify-site\node_modules\yoga-layout-prebuilt\yoga-layout\build\Release\nbind.js:53
        throw ex;
        ^

Error: The specified module could not be found.
\\?\D:\FC\gatsby-shopify-site\node_modules\@parcel\source-map\parcel_sourcemap_node\artifacts\index.win32-x64-msvc.node
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1185:18)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (D:\FC\gatsby-shopify-site\node_modules\@parcel\source-map\parcel_sourcemap_node\index.js:15:18)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (D:\FC\gatsby-shopify-site\node_modules\@parcel\source-map\dist\node.js:14:18)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
    at Module.load (node:internal/modules/cjs/loader:981:32) {
  code: 'ERR_DLOPEN_FAILED'
}

package.json

{
  "name": "test-site",
  "version": "1.0.0",
  "private": true,
  "description": "test-site",
  "keywords": [
    "gatsby"
  ],
  "scripts": {
    "develop": "gatsby develop",
    "start": "gatsby develop",
    "build": "gatsby build",
    "serve": "gatsby serve",
    "clean": "gatsby clean"
  },
  "dependencies": {
    "gatsby": "^4.9.0",
    "react": "^17.0.1",
    "react-dom": "^17.0.1"
  }
}

gatsby-config.js

module.exports = {
    siteMetadata: {
        siteUrl: `https://www.yourdomain.tld`,
    },
    plugins: [

    ]
}

PLEASE HELP!!!

CodePudding user response:

Where (in what folder) have you run npm install?

In D drive and inside FC folder

You must install your dependencies inside your project folder, so inside gatsby-shopify-site. In your case, you installed your dependencies in the parent folder (FC),

Move inside D:\FC\gatsby-shopify-site and run:

npm install

Once done:

gatsby develop

CodePudding user response:

Could you try yarn instead?

npm install -g yarn

and then run your command like this

yarn run develop
  • Related