'.' is not recognized as an internal or external command for relay full stack

1.1k views Asked by At

I am trying to use relay full stack.

https://github.com/lvarayut/relay-fullstack

But I am getting an error like

'.' is not recognized as an internal or external command,
operable program or batch file

enter image description here

Here is my package.json file

{
  "name": "relay-fullstack",
  "version": "1.0.0",
  "description": "Relay Fullstack, Powered by Relay Fullstack",
  "scripts": {
    "start": "nodemon --watch server/data/**/*.js --exec \"npm run update && ./node_modules/.bin/babel-node server/index.js\"",
    "update": "./node_modules/.bin/babel-node server/utils/updateSchema.js",
    "deploy": "npm run clean && cross-env NODE_ENV=production webpack --config webpack.config.js && npm run update && npm run build-server && cross-env NODE_ENV=production node ./build/index.js",
    "build-server": "cross-env NODE_ENV=production ./node_modules/.bin/babel ./server --out-dir ./build",
    "lint": "eslint --ignore-path .gitignore client server",
    "heroku-postbuild": "cross-env NODE_ENV=production webpack --config webpack.config.js && cross-env NODE_ENV=production ./node_modules/.bin/babel ./server --out-dir ./lib",
    "clean": "rm -rf build && mkdir build"
  },
  "pre-commit": "lint",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/lvarayut/relay-fullstack.git"
  },
  "engines": {
    "node": "6.6.0",
    "npm": "3.10.8"
  },
  "keywords": [
    "react",
    "relay",
    "graphql",
    "express",
    "es6",
    "es7",
    "jsx",
    "webpack",
    "babel",
    "material design lite",
    "postcss",
    "scaffolding",
    "fullstack"
  ],
  "author": "Varayut Lerdkanlayanawat",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/lvarayut/relay-fullstack/issues"
  },
  "homepage": "https://github.com/lvarayut/relay-fullstack",
  "devDependencies": {
    "eslint": "^3.8.0",
    "eslint-config-airbnb": "^12.0.0",
    "eslint-plugin-import": "^2.0.1",
    "eslint-plugin-jsx-a11y": "^2.2.3",
    "eslint-plugin-react": "^6.4.1",
    "nodemon": "^1.11.0",
    "pre-commit": "^1.1.3",
    "react-transform-catch-errors": "^1.0.2",
    "react-transform-hmr": "^1.0.4",
    "redbox-react": "^1.3.2"
  },
  "dependencies": {
    "autoprefixer": "^6.5.1",
    "babel-cli": "^6.16.0",
    "babel-core": "^6.17.0",
    "babel-eslint": "^7.0.0",
    "babel-loader": "^6.2.5",
    "babel-plugin-react-transform": "^2.0.2",
    "babel-preset-es2015": "^6.16.0",
    "babel-preset-react": "^6.16.0",
    "babel-preset-stage-0": "^6.16.0",
    "babel-relay-plugin": "^0.9.3",
    "chalk": "^1.1.3",
    "connect-history-api-fallback": "^1.3.0",
    "cross-env": "^3.1.3",
    "css-loader": "^0.25.0",
    "express": "^4.14.0",
    "express-graphql": "^0.5.4",
    "favicons-webpack-plugin": "0.0.7",
    "file-loader": "^0.9.0",
    "graphql": "^0.7.2",
    "graphql-relay": "^0.4.3",
    "html-webpack-plugin": "^2.22.0",
    "lodash": "^4.16.4",
    "normalize.css": "^5.0.0",
    "postcss-loader": "^1.0.0",
    "precss": "^1.4.0",
    "react": "^15.3.2",
    "react-dom": "^15.3.2",
    "react-dropdown": "^1.1.0",
    "react-mdl": "^1.7.2",
    "react-relay": "^0.9.3",
    "react-router": "^2.8.1",
    "react-router-relay": "^0.13.5",
    "style-loader": "^0.13.1",
    "url-loader": "^0.5.7",
    "webpack": "^1.13.2",
    "webpack-dev-server": "^1.16.2"
  }
}

server/utils/updateSchema.js file

/* eslint-disable no-console */
import path from 'path';
import fs from 'fs';
import { graphql } from 'graphql';
import chalk from 'chalk';
import { introspectionQuery, printSchema } from 'graphql/utilities';
import schema from '../data/schema';

const jsonFile = path.join(__dirname, '../data/schema.json');
const graphQLFile = path.join(__dirname, '../data/schema.graphql');

async function updateSchema() {
  try {
    const json = await graphql(schema, introspectionQuery);
    fs.writeFileSync(jsonFile, JSON.stringify(json, null, 2));
    fs.writeFileSync(graphQLFile, printSchema(schema));
    console.log(chalk.green('Schema has been regenerated'));
  } catch (err) {
    console.error(chalk.red(err.stack));
  }
}

// Run the function directly, if it's called from the command line
if (!module.parent) updateSchema();

export default updateSchema;

What should I do to get relay-fullstack running? Thanks.

1

There are 1 answers

0
mehta-rohan On

Error resides between:

"scripts": { "start": "nodemon --watch server/data/**/*.js --exec \"npm run update && ./node_modules/.bin/babel-node server/index.js\"", "update": "./node_modules/.bin/babel-node server/utils/updateSchema.js", "deploy": "npm run clean && cross-env NODE_ENV=production webpack --config webpack.config.js && npm run update && npm run build-server && cross-env NODE_ENV=production node ./build/index.js", "build-server": "cross-env NODE_ENV=production ./node_modules/.bin/babel ./server --out-dir ./build", "lint": "eslint --ignore-path .gitignore client server", "heroku-postbuild": "cross-env NODE_ENV=production webpack --config webpack.config.js && cross-env NODE_ENV=production ./node_modules/.bin/babel ./server --out-dir ./lib", "clean": "rm -rf build && mkdir build" }

I think you should focus on update command used in script tag( package. json)