2017-07-07 44 views
0

我正嘗試使用繼電器完整堆棧。'。'不被識別爲繼電器全堆棧的內部或外部命令

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

但我得到了如下的錯誤

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

enter image description here

這裏是我的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運行? 謝謝。

+0

請上傳您的updateSchema.js文件更新命令(錯誤似乎與它相關) – Pineda

+0

好..剛剛上傳.. –

回答

0

錯誤所在之間:

"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" }

我想你應該專注於腳本標籤(包JSON)使用

相關問題