react初体验

react

Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。


D:\WebstormProjects\hello-react>create-react-app hello-world


Creating a new React app in D:\WebstormProjects\hello-react\hello-world.


Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...


npm ERR! code EINTEGRITY
npm ERR! sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg== integrity checksum failed when using sha512: wanted sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrH
mcGgmrbsW3MHfmtIf+vJumgQn+PrXg== but got sha512-z4PhNX7vuL3xVChQ1m2AB9Yg5AULVxXcg/SpIdNs6c5H0NE8XYXysP+DGNKHfuwvY7kxvUdBeoGlODJ6+SfaPg==. (0 bytes)


npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2018-04-01T08_46_45_559Z-debug.log


Aborting installation.
  npm install --save --save-exact --loglevel error react react-dom react-scripts has failed.


Deleting generated file... node_modules
Deleting generated file... package.json
Deleting hello-world / from D:\WebstormProjects\hello-react
Done.


D:\WebstormProjects\hello-react>create-react-app hello-world


Creating a new React app in D:\WebstormProjects\hello-react\hello-world.


Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...




> [email protected] postinstall D:\WebstormProjects\hello-react\hello-world\node_modules\uglifyjs-webpack-plugin
> node lib/post_install.js


+ [email protected]
+ react-d[email protected]
+ [email protected]
added 1327 packages in 695.995s


Success! Created hello-world at D:\WebstormProjects\hello-react\hello-world
Inside that directory, you can run several commands:


  npm start
    Starts the development server.


  npm run build
    Bundles the app into static files for production.


  npm test
    Starts the test runner.


  npm run eject
    Removes this tool and copies build dependencies, configuration files
    and scripts into the app directory. If you do this, you can’t go back!


We suggest that you begin by typing:


  cd hello-world
  npm start


Happy hacking!


D:\WebstormProjects\hello-react>npm start
npm ERR! path D:\WebstormProjects\hello-react\package.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'D:\WebstormProjects\hello-react\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent


npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2018-04-01T09_20_22_508Z-debug.log


D:\WebstormProjects\hello-react>cd hello-world


D:\WebstormProjects\hello-react\hello-world>npm start


> [email protected] start D:\WebstormProjects\hello-react\hello-world
> react-scripts start


Compiled successfully!


You can now view hello-world in the browser.


Compiled successfully!


You can now view hello-world in the browser.


  Local:            http://localhost:3000/
  On Your Network:  http://192.168.1.105:3000/


Note that the development build is not optimized.

To create a production build, use npm run build.


以上是 react初体验 的全部内容, 来源链接: utcz.com/z/383789.html

回到顶部