首页 > babel和react都安装失败怎么回事,没有报错,但是react-v报command not found

babel和react都安装失败怎么回事,没有报错,但是react-v报command not found

Last login: Mon Jan 11 22:23:41 on ttys000
czdeMacBook-Pro:~ cz$ cd sikeio-buyshoes-react
czdeMacBook-Pro:sikeio-buyshoes-react cz$ npm install react@0.13.3 --save-dev
buyshoes@1.0.0 /Users/cz/sikeio-buyshoes-react
└── babel-preset-es2015@6.3.13  extraneous

npm WARN buyshoes@1.0.0 No repository field.
czdeMacBook-Pro:sikeio-buyshoes-react cz$ react -v
-bash: react: command not found
czdeMacBook-Pro:sikeio-buyshoes-react cz$ npm install babel@5.8.23 --save-dev
buyshoes@1.0.0 /Users/cz/sikeio-buyshoes-react
├─┬ babel@5.8.23 
│ ├─┬ babel-core@5.8.34 
│ │ ├── babel-plugin-constant-folding@1.0.1 
│ │ ├── babel-plugin-dead-code-elimination@1.0.2 
│ │ ├── babel-plugin-eval@1.0.1 
│ │ ├── babel-plugin-inline-environment-variables@1.0.1 
│ │ ├── babel-plugin-jscript@1.0.4 
│ │ ├── babel-plugin-member-expression-literals@1.0.1 
│ │ ├── babel-plugin-property-literals@1.0.1 
│ │ ├── babel-plugin-proto-to-assign@1.0.4 
│ │ ├── babel-plugin-react-constant-elements@1.0.3 
│ │ ├── babel-plugin-react-display-name@1.0.3 
│ │ ├── babel-plugin-remove-console@1.0.1 
│ │ ├── babel-plugin-remove-debugger@1.0.1 
│ │ ├── babel-plugin-runtime@1.0.7 
│ │ ├─┬ babel-plugin-undeclared-variables-check@1.0.2 
│ │ │ └── leven@1.0.2 
│ │ ├── babel-plugin-undefined-to-void@1.1.6 
│ │ ├── babylon@5.8.34 
│ │ ├── bluebird@2.10.2 
│ │ ├── globals@6.4.1 
│ │ ├── js-tokens@1.0.1 
│ │ ├─┬ regenerator@0.8.40 
│ │ │ ├─┬ commoner@0.10.4 
│ │ │ │ ├─┬ detective@4.3.1 
│ │ │ │ │ ├── acorn@1.2.2 
│ │ │ │ │ └── defined@1.0.0 
│ │ │ │ ├── iconv-lite@0.4.13 
│ │ │ │ └── q@1.4.1 
│ │ │ ├─┬ defs@1.1.1 
│ │ │ │ ├─┬ alter@0.2.0 
│ │ │ │ │ └── stable@0.1.5 
│ │ │ │ ├── ast-traverse@0.1.1 
│ │ │ │ ├── breakable@1.0.0 
│ │ │ │ ├── esprima-fb@15001.1001.0-dev-harmony-fb 
│ │ │ │ ├── simple-fmt@0.1.0 
│ │ │ │ ├── simple-is@0.2.0 
│ │ │ │ ├── stringmap@0.2.2 
│ │ │ │ ├── stringset@0.2.1 
│ │ │ │ ├── tryor@0.1.2 
│ │ │ │ └─┬ yargs@3.27.0 
│ │ │ │   ├── camelcase@1.2.1 
│ │ │ │   ├─┬ cliui@2.1.0 
│ │ │ │   │ ├─┬ center-align@0.1.2 
│ │ │ │   │ │ ├─┬ align-text@0.1.3 
│ │ │ │   │ │ │ ├── kind-of@2.0.1 
│ │ │ │   │ │ │ └── longest@1.0.1 
│ │ │ │   │ │ └── lazy-cache@0.2.7 
│ │ │ │   │ ├── right-align@0.1.3 
│ │ │ │   │ └── wordwrap@0.0.2 
│ │ │ │   ├─┬ os-locale@1.4.0 
│ │ │ │   │ └─┬ lcid@1.0.0 
│ │ │ │   │   └── invert-kv@1.0.0 
│ │ │ │   ├── window-size@0.1.4 
│ │ │ │   └── y18n@3.2.0 
│ │ │ ├── esprima-fb@15001.1001.0-dev-harmony-fb 
│ │ │ └─┬ recast@0.10.33 
│ │ │   └── ast-types@0.8.12 
│ │ ├─┬ regexpu@1.3.0
│ │ │ └─┬ recast@0.10.42
│ │ │   └── esprima-fb@15001.1001.0-dev-harmony-fb 
│ │ ├── resolve@1.1.6 
│ │ ├── source-map@0.5.3 
│ │ └── try-resolve@1.0.1 
│ └── source-map@0.4.4 
├─┬ babel-cli@6.4.0
│ └── source-map@0.5.3 
└── babel-preset-es2015@6.3.13  extraneous

npm WARN buyshoes@1.0.0 No repository field.
czdeMacBook-Pro:sikeio-buyshoes-react cz$ babel --version
-bash: babel: command not found

TUT怎么回事,是照着教程写的,感觉npm安装什么都不太正常


你要全局安装才有全局的命令啊… 项目内安装只有在 package.json 的 scripts 中才有命令的…

【热门文章】
【热门文章】