検索

ホームページ  >  に質問  >  本文

node.js - npm install ,npm start 项目运行不起来了呀。。各种报错。。求解

最后一个是日志。。哪个小伙伴能帮忙给的解释不。。多谢。
这是package.json
{
"name": "react-mgm",
"version": "1.2.56",
"description": "",
"main": "src/index.js",
"less": "src/index.less",
"scripts": {

"precommit": "eslint ./src/component/",
"pre": "npm install;",
"clear": "rm -rf build; mkdir build;",
"start": "npm run clear; webpack-dev-server --config webpack.config.dev.js --port 4000 --host 0.0.0.0 --inline --hot --devtool eval --progress --color --profile",
"deploy": "npm install; npm run build && npm run build:min",
"build": "webpack --progress --color --profile",
"build:min": "webpack --config webpack.config.min.js",
"publishpatch": "npm run deploy; git add --all; git commit -m 'c'; npm version patch; git push origin master:master; npm publish; npm publish --registry='https://registry.npmjs.org'; cnpm sync react-mgm; npm version;"

},
"repository": {

"type": "git",
"url": "git+https://github.com/gmfe/react-mgm.git"

},
"author": "",
"license": "ISC",
"bugs": {

"url": "https://github.com/gmfe/react-mgm/issues"

},
"homepage": "https://github.com/gmfe/react-mgm#readme",
"devDependencies": {

"assets-webpack-plugin": "^3.4.0",
"autoprefixer": "^6.3.5",
"babel-core": "^6.7.4",
"babel-loader": "^6.2.4",
"babel-preset-es2015": "^6.6.0",
"babel-preset-react": "^6.5.0",
"babel-preset-stage-0": "^6.5.0",
"classnames": "^2.2.3",
"css-loader": "^0.23.1",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.8.5",
"gm-mfont": "^1.0.7",
"gm-util": "^2.0.3",
"husky": "^0.11.4",
"less": "^2.6.1",
"less-loader": "^2.2.3",
"path": "^0.12.7",
"postcss-loader": "^0.8.2",
"precss": "^1.4.0",
"react": "^15.0.1",
"react-addons-css-transition-group": "^15.0.1",
"react-dom": "^15.0.1",
"react-router": "^2.2.4",
"style-loader": "^0.13.1",
"underscore": "^1.8.3",
"url-loader": "^0.5.7",
"webpack": "^1.12.14",
"webpack-dev-server": "^1.14.1"

}
}

大家讲道理大家讲道理2786日前672

全員に返信(3)返信します

  • 天蓬老师

    天蓬老师2017-04-17 14:23:12

    看起来应该是缺了一叫clear的脚本命令,把你的package.json贴出来吧

    补充:

    原来如此,你看clear命令是这样的:"clear": "rm -rf build; mkdir build;",,而你的运行环境是windowscmd。好惨,这些rm之类的命令不能用啊!!!

    建议:

    装了git的,可以用git bash运行,放弃你的cmd吧。

    也可以装Cygwin(也是一个仿linux shell的命令行环境),放弃你的cmd

    返事
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-17 14:23:12

    建议在Linux下开发nodejs,可以使用virtualbox创建虚拟机…

    返事
    0
  • 天蓬老师

    天蓬老师2017-04-17 14:23:12

    MING64下 改成这样试试,我感觉你这貌似讲 clear: 识别成一个命令了

    "start": "npm run clear && webpack-dev-server --config webpack.config.dev.js --port 4000 --host 0.0.0.0 --inline --hot --devtool eval --progress --color --profile"

    返事
    0
  • キャンセル返事