React - Exemplo01

guia-frontend

#1

Ola, fiquei com dúvidas no livro Guia-Front-end na parte do React: pagina: 77 e 78.
Eu instalei o react e o react-down conforme o comando abaixo informa no livro:

npm install --save react react-down

porém aparece a msg de erro abaixo:

npm ERR! Darwin 16.7.0
npm ERR! argv "/usr/local/Cellar/node/6.8.1/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v6.8.1
npm ERR! npm  v3.10.8
npm ERR! code ETARGET

npm ERR! notarget No compatible version found: react-down@^15.3.2
npm ERR! notarget Valid install targets:
npm ERR! notarget 0.4.1, 0.4.0, 0.3.0, 0.2.0, 0.1.0
npm ERR! notarget 
npm ERR! notarget This is most likely not a problem with npm itself.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget 
npm ERR! notarget It was specified as a dependency of 'react'
npm ERR! notarget 

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/alexandrenilton/Dropbox/dev-src/Livro-GuiaFrontEnd/react/npm-debug.log

Alguem poderia me ajudar?

Eis o meu package.json

{
  "name": "react",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "react": "^15.3.2",
    "react-down": "^15.3.2"
  },
  "devDependencies": {
    "webpack": "^3.10.0"
  }
}

Conteúdo do log de erro:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/6.8.1/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'install',
1 verbose cli   '--save',
1 verbose cli   'react',
1 verbose cli   'react-down' ]
2 info using npm@3.10.8
3 info using node@v6.8.1
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData react@^15.3.2
8 silly fetchPackageMetaData react-down@^15.3.2
9 silly fetchNamedPackageData react
10 silly mapToRegistry name react
11 silly mapToRegistry using default registry
12 silly mapToRegistry registry https://registry.npmjs.org/
13 silly mapToRegistry data Result {
13 silly mapToRegistry   raw: 'react',
13 silly mapToRegistry   scope: null,
13 silly mapToRegistry   escapedName: 'react',
13 silly mapToRegistry   name: 'react',
13 silly mapToRegistry   rawSpec: '',
13 silly mapToRegistry   spec: 'latest',
13 silly mapToRegistry   type: 'tag' }
14 silly mapToRegistry uri https://registry.npmjs.org/react
15 silly fetchNamedPackageData react-down
16 silly mapToRegistry name react-down
17 silly mapToRegistry using default registry
18 silly mapToRegistry registry https://registry.npmjs.org/
19 silly mapToRegistry data Result {
19 silly mapToRegistry   raw: 'react-down',
19 silly mapToRegistry   scope: null,
19 silly mapToRegistry   escapedName: 'react-down',
19 silly mapToRegistry   name: 'react-down',
19 silly mapToRegistry   rawSpec: '',
19 silly mapToRegistry   spec: 'latest',
19 silly mapToRegistry   type: 'tag' }
20 silly mapToRegistry uri https://registry.npmjs.org/react-down
21 verbose request uri https://registry.npmjs.org/react-down
22 verbose request no auth needed
23 info attempt registry request try #1 at 8:52:03 AM
24 verbose request id ab39d6bb8a2e623c
25 verbose etag "5862b917-2ba8"
26 verbose lastModified Tue, 27 Dec 2016 18:55:19 GMT
27 http request GET https://registry.npmjs.org/react-down
28 verbose request uri https://registry.npmjs.org/react
29 verbose request no auth needed
30 info attempt registry request try #1 at 8:52:03 AM
31 verbose etag "5a3b6a81-32bf0"
32 verbose lastModified Thu, 21 Dec 2017 8:02:09 GMT
33 http request GET https://registry.npmjs.org/react
34 http 304 https://registry.npmjs.org/react-down
35 verbose headers { date: 'Mon, 25 Dec 2017 10:52:04 GMT',
35 verbose headers   via: '1.1 varnish',
35 verbose headers   'cache-control': 'max-age=300',
35 verbose headers   etag: '"5862b917-2ba8"',
35 verbose headers   age: '893',
35 verbose headers   connection: 'keep-alive',
35 verbose headers   'x-served-by': 'cache-gru17121-GRU',
35 verbose headers   'x-cache': 'HIT',
35 verbose headers   'x-cache-hits': '1',
35 verbose headers   'x-timer': 'S1514199124.180865,VS0,VE0',
35 verbose headers   vary: 'Accept-Encoding, Accept' }
36 silly get cb [ 304,
36 silly get   { date: 'Mon, 25 Dec 2017 10:52:04 GMT',
36 silly get     via: '1.1 varnish',
36 silly get     'cache-control': 'max-age=300',
36 silly get     etag: '"5862b917-2ba8"',
36 silly get     age: '893',
36 silly get     connection: 'keep-alive',
36 silly get     'x-served-by': 'cache-gru17121-GRU',
36 silly get     'x-cache': 'HIT',
36 silly get     'x-cache-hits': '1',
36 silly get     'x-timer': 'S1514199124.180865,VS0,VE0',
36 silly get     vary: 'Accept-Encoding, Accept' } ]
37 verbose etag https://registry.npmjs.org/react-down from cache
38 verbose get saving react-down to /Users/alexandrenilton/.npm/registry.npmjs.org/react-down/.cache.json
39 verbose correctMkdir /Users/alexandrenilton/.npm correctMkdir not in flight; initializing
40 silly fetchNamedPackageData No valid target from cache, forcing network
41 verbose request uri https://registry.npmjs.org/react-down
42 verbose request no auth needed
43 info attempt registry request try #1 at 8:52:04 AM
44 http request GET https://registry.npmjs.org/react-down
45 http 200 https://registry.npmjs.org/react-down
46 verbose headers { 'content-type': 'application/json; charset=UTF-8',
46 verbose headers   server: 'UploadServer',
46 verbose headers   'cache-control': 'max-age=300',
46 verbose headers   'last-modified': 'Tue, 27 Dec 2016 18:55:19 GMT',
46 verbose headers   etag: '"5862b917-2ba8"',
46 verbose headers   'content-encoding': 'gzip',
46 verbose headers   'content-length': '2456',
46 verbose headers   'accept-ranges': 'bytes',
46 verbose headers   date: 'Mon, 25 Dec 2017 10:52:04 GMT',
46 verbose headers   via: '1.1 varnish',
46 verbose headers   age: '893',
46 verbose headers   connection: 'keep-alive',
46 verbose headers   'x-served-by': 'cache-gru17121-GRU',
46 verbose headers   'x-cache': 'HIT',
46 verbose headers   'x-cache-hits': '2',
46 verbose headers   'x-timer': 'S1514199124.254404,VS0,VE0',
46 verbose headers   vary: 'Accept-Encoding, Accept' }
47 silly get cb [ 200,
47 silly get   { 'content-type': 'application/json; charset=UTF-8',
47 silly get     server: 'UploadServer',
47 silly get     'cache-control': 'max-age=300',
47 silly get     'last-modified': 'Tue, 27 Dec 2016 18:55:19 GMT',
47 silly get     etag: '"5862b917-2ba8"',
47 silly get     'content-encoding': 'gzip',
47 silly get     'content-length': '2456',
47 silly get     'accept-ranges': 'bytes',
47 silly get     date: 'Mon, 25 Dec 2017 10:52:04 GMT',
47 silly get     via: '1.1 varnish',
47 silly get     age: '893',
47 silly get     connection: 'keep-alive',
47 silly get     'x-served-by': 'cache-gru17121-GRU',
47 silly get     'x-cache': 'HIT',
47 silly get     'x-cache-hits': '2',
47 silly get     'x-timer': 'S1514199124.254404,VS0,VE0',
47 silly get     vary: 'Accept-Encoding, Accept' } ]
48 verbose get saving react-down to /Users/alexandrenilton/.npm/registry.npmjs.org/react-down/.cache.json
49 verbose correctMkdir /Users/alexandrenilton/.npm correctMkdir not in flight; initializing
50 silly fetchPackageMetaData Error: No compatible version found: react-down@^15.3.2
50 silly fetchPackageMetaData Valid install targets:
50 silly fetchPackageMetaData 0.4.1, 0.4.0, 0.3.0, 0.2.0, 0.1.0
50 silly fetchPackageMetaData
50 silly fetchPackageMetaData     at pickVersionFromRegistryDocument (/usr/local/lib/node_modules/npm/lib/fetch-package-metadata.js:178:16)
50 silly fetchPackageMetaData     at /usr/local/lib/node_modules/npm/node_modules/iferr/index.js:13:50
50 silly fetchPackageMetaData     at /usr/local/lib/node_modules/npm/lib/utils/pulse-till-done.js:20:8
50 silly fetchPackageMetaData     at saved (/usr/local/lib/node_modules/npm/lib/cache/caching-client.js:174:7)
50 silly fetchPackageMetaData     at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:233:18
50 silly fetchPackageMetaData     at FSReqWrap.oncomplete (fs.js:123:15)
50 silly fetchPackageMetaData  error for react-down@^15.3.2 { Error: No compatible version found: react-down@^15.3.2
50 silly fetchPackageMetaData Valid install targets:
50 silly fetchPackageMetaData 0.4.1, 0.4.0, 0.3.0, 0.2.0, 0.1.0
50 silly fetchPackageMetaData
50 silly fetchPackageMetaData     at pickVersionFromRegistryDocument (/usr/local/lib/node_modules/npm/lib/fetch-package-metadata.js:178:16)
50 silly fetchPackageMetaData     at /usr/local/lib/node_modules/npm/node_modules/iferr/index.js:13:50
50 silly fetchPackageMetaData     at /usr/local/lib/node_modules/npm/lib/utils/pulse-till-done.js:20:8
50 silly fetchPackageMetaData     at saved (/usr/local/lib/node_modules/npm/lib/cache/caching-client.js:174:7)
50 silly fetchPackageMetaData     at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:233:18
50 silly fetchPackageMetaData     at FSReqWrap.oncomplete (fs.js:123:15) code: 'ETARGET' }
51 http 304 https://registry.npmjs.org/react
52 verbose headers { date: 'Mon, 25 Dec 2017 10:52:04 GMT',
52 verbose headers   via: '1.1 varnish',
52 verbose headers   'cache-control': 'max-age=300',
52 verbose headers   etag: '"5a3b6a81-32bf0"',
52 verbose headers   age: '933',
52 verbose headers   connection: 'keep-alive',
52 verbose headers   'x-served-by': 'cache-gru17122-GRU',
52 verbose headers   'x-cache': 'HIT',
52 verbose headers   'x-cache-hits': '5',
52 verbose headers   'x-timer': 'S1514199124.349972,VS0,VE0',
52 verbose headers   vary: 'Accept-Encoding, Accept' }
53 silly get cb [ 304,
53 silly get   { date: 'Mon, 25 Dec 2017 10:52:04 GMT',
53 silly get     via: '1.1 varnish',
53 silly get     'cache-control': 'max-age=300',
53 silly get     etag: '"5a3b6a81-32bf0"',
53 silly get     age: '933',
53 silly get     connection: 'keep-alive',
53 silly get     'x-served-by': 'cache-gru17122-GRU',
53 silly get     'x-cache': 'HIT',
53 silly get     'x-cache-hits': '5',
53 silly get     'x-timer': 'S1514199124.349972,VS0,VE0',
53 silly get     vary: 'Accept-Encoding, Accept' } ]
54 verbose etag https://registry.npmjs.org/react from cache
55 verbose get saving react to /Users/alexandrenilton/.npm/registry.npmjs.org/react/.cache.json
56 verbose correctMkdir /Users/alexandrenilton/.npm correctMkdir not in flight; initializing
57 silly rollbackFailedOptional Starting
58 silly rollbackFailedOptional Finishing
59 silly runTopLevelLifecycles Finishing
60 silly install printInstalled
61 verbose stack Error: No compatible version found: react-down@^15.3.2
61 verbose stack Valid install targets:
61 verbose stack 0.4.1, 0.4.0, 0.3.0, 0.2.0, 0.1.0
61 verbose stack
61 verbose stack     at pickVersionFromRegistryDocument (/usr/local/lib/node_modules/npm/lib/fetch-package-metadata.js:178:16)
61 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/iferr/index.js:13:50
61 verbose stack     at /usr/local/lib/node_modules/npm/lib/utils/pulse-till-done.js:20:8
61 verbose stack     at saved (/usr/local/lib/node_modules/npm/lib/cache/caching-client.js:174:7)
61 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:233:18
61 verbose stack     at FSReqWrap.oncomplete (fs.js:123:15)
62 verbose cwd /Users/alexandrenilton/Dropbox/dev-src/Livro-GuiaFrontEnd/react
63 error Darwin 16.7.0
64 error argv "/usr/local/Cellar/node/6.8.1/bin/node" "/usr/local/bin/npm" "install" "--save" "react" "react-down"
65 error node v6.8.1
66 error npm  v3.10.8
67 error code ETARGET
68 error notarget No compatible version found: react-down@^15.3.2
68 error notarget Valid install targets:
68 error notarget 0.4.1, 0.4.0, 0.3.0, 0.2.0, 0.1.0
69 error notarget This is most likely not a problem with npm itself.
69 error notarget In most cases you or one of your dependencies are requesting
69 error notarget a package version that doesn't exist.
70 verbose exit [ 1, true ]

#2

Descobri o erro.

Coloquei o nome do diretório de react, ai ele não consegue instalar… pois ele usa o diretório como nome do projeto… impossibilitando de instalar o react dentro do react… Erro meu. Mas fica ai registrado se alguem precisar