繁体   English   中英

'' 不被识别为继电器满堆栈的内部或外部命令

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

我正在尝试使用中继全栈。

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

但是我收到一个错误

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

在此处输入图片说明

这是我的package.json文件

{
  "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文件

/* 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;

我应该怎么做才能使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" }

我认为您应该专注于脚本标记(package。json)中使用的更新命令

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM