Open-Federation / json-schema-editor-visual

A json-schema editor of high efficient and easy-to-use, base on React.
https://hellosean1025.github.io/json-schema-visual-editor/
MIT License
1.02k stars 224 forks source link

build时候错误 #46

Open siguang1983 opened 4 years ago

siguang1983 commented 4 years ago

SG:json-schema-editor-visual siguang.liu$ yarn build yarn run v1.7.0 warning package.json: License should be a valid SPDX license expression $ NODE_ENV=production webpack /Users/siguang.liu/Downloads/json/json-schema-editor-visual/node_modules/webpack-cli/bin/config-yargs.js:89 describe: optionsSchema.definitions.output.properties.path.description, ^

TypeError: Cannot read property 'properties' of undefined at module.exports (/Users/siguang.liu/Downloads/json/json-schema-editor-visual/node_modules/webpack-cli/bin/config-yargs.js:89:48) at /Users/siguang.liu/Downloads/json/json-schema-editor-visual/node_modules/webpack-cli/bin/webpack.js:60:27 at Object. (/Users/siguang.liu/Downloads/json/json-schema-editor-visual/node_modules/webpack-cli/bin/webpack.js:515:3) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:20:18) error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Ninju commented 4 years ago

https://github.com/plotly/dash-component-boilerplate/issues/12

First answer worked for me

This was broken by a webpack update, see webpack/webpack#8082 A workaround for now is to update both, webpack and webpack-cli in package.json:
"webpack": "^4.20.2",
"webpack-cli": "^3.1.1",

febaoshan commented 4 years ago

I found this problem was caused by the config of 'NODE_ENV' setting method in package.json. You can replace the package.json content with following code:

{
  "name": "json-schema-editor-visual",
  "version": "1.1.1",
  "description": "jsonschema editor",
  "main": "package/index.js",
  "license": "MIC",
  "scripts": {
    "start": "ykit s -p 8082",
    "demo": "set NODE_ENV='production' && ykit pack -m",
    "build": "set NODE_ENV='production' && webpack"
  },
  "dependencies": {
    "antd": "^3.1.6",
    "brace": "^0.10.0",
    "generate-schema": "^2.6.0",
    "moox": "^1.0.2",
    "react-redux": "^5.0.6",
    "underscore": "^1.8.3"
  },
  "devDependencies": {
    "autoprefixer": "^7.2.1",
    "babel-cli": "^6.26.0",
    "babel-core": "^6.26.0",
    "babel-loader": "^7.1.4",
    "babel-plugin-import": "^1.7.0",
    "babel-plugin-transform-class-properties": "^6.24.1",
    "babel-preset-env": "^1.6.1",
    "babel-preset-react": "^6.24.1",
    "babel-preset-react-app": "^3.1.0",
    "cross-env": "^5.1.1",
    "css-loader": "^0.28.11",
    "extract-text-webpack-plugin": "^4.0.0-beta.0",
    "less": "^2.7.2",
    "less-loader": "^4.1.0",
    "react-addons-perf": "^15.4.2",
    "style-loader": "^0.20.3",
    "webpack": "4.20.2",
    "webpack-cli": "3.1.1",
    "ykit-config-antd": "^1.2.0",
    "ykit": "^0.8.13"
  }
}