-1

Ao tentar instalar dependências em meu projeto, recebo a seguinte mensagem de erro:

inserir a descrição da imagem aqui

Digitei

npm i --save-dev [email protected]

Recebi o erro acima. O mesmo acontece com outras dependências.


Segue o log:

0 info it worked if it ends with ok

1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',

1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',

1 verbose cli   'install',

1 verbose cli   '-g',

1 verbose cli   'npm' ]

2 info using [email protected]

3 info using [email protected]

4 verbose npm-session 6b7fffb5af9f5e00

5 silly install loadCurrentTree

6 silly install readGlobalPackageData

7 http fetch GET 405 http://registry.npmjs.org/extract-text-webpack-plugins/npm 313ms

8 silly fetchPackageMetaData error for npm@latest 405 Method Not Allowed - GET http://registry.npmjs.org/extract-text-webpack-plugins/npm

9 timing stage:rollbackFailedOptional Completed in 0ms

10 timing stage:runTopLevelLifecycles Completed in 338ms

11 verbose stack Error: 405 Method Not Allowed - GET http://registry.npmjs.org/extract-text-webpack-plugins/npm

11 verbose stack     at res.buffer.catch.then.body (C:\Program 
Files\nodejs\node_modules\npm\node_modules\npm-registry-fetch\check-response.js:104:15)

11 verbose stack     at process._tickCallback (internal/process/next_tick.js:68:7)

12 verbose statusCode 405

13 verbose pkgid npm@latest

14 verbose cwd C:\Users\Felipe\Desktop\estudos-react-felipe\todo-app\frontend

15 verbose Windows_NT 10.0.17134

16 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "npm"
17 verbose node v10.16.3

18 verbose npm  v6.9.0

19 error code E405

20 error 405 Method Not Allowed - GET http://registry.npmjs.org/extract-text-webpack-plugins/npm

21 verbose exit [ 1, true ]
3
  • Amigo, seria interessante você postar o log do arquivo 2019-08-26T14_05_41_022Z-debug.log, conforme informado no seu erro. 26/08/2019 às 14:26
  • Que versão do NPM está utilizando?
    – Woss
    26/08/2019 às 14:30
  • estou usando a Versão 6.9.0 26/08/2019 às 14:35

1 Resposta 1

0

O pacote extract-text-webpack-plugins não está mais disponível na NPM, logo não tem como instalar.

Aliais, era para ocorrer erro 404:

C:\teste>npm i --save-dev [email protected]
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/extract-text-webpack-plugins - Not found
npm ERR! 404
npm ERR! 404  '[email protected]' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\new_g\AppData\Roaming\npm-cache\_logs\2019-08-26T14_14_34_618Z-debug.log

Que quer dizer não encontrado, 405 provavelmente ocorreu por um dos seguintes motivos:

  • Bug na sua versão do NPM
  • Está usando algum proxy

Como instalar um pacote fora da NPM?

Como eu disse, não existe mais este pacote na NPM, se acessar https://github.com/webpack-contrib/extract-text-webpack-plugin#deprecated irá ler a mensagem:

DEPRECATED

Please use: https://github.com/webpack-contrib/mini-css-extract-plugin

Resumindo, você pode experimentar o (não sei se funciona com webpack1):

npm install --save-dev mini-css-extract-plugin

Ou então se deseja mesmo usar uma pacote que não existe na NPM instale apontando um link de um repositório online, exemplo:

npm install user-name/repo-name#webpack-1 --save-dev

Esta não é a resposta que você está procurando? Pesquise outras perguntas com a tag .