Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can't install react-dom/test-utils via npm

I've added two libraries to my package.json

  "devDependencies": {
    ...
    "react-dom/test-utils": "*",
    "react-test-renderer/shallow": "*"
  },

as suggested by react docs to be compliant with version 16 of react ecosystem.

After running npm install --verbose I got this:

18 verbose node v8.5.0
19 verbose npm  v5.3.0
20 error code EINVALIDPACKAGENAME
21 error Invalid package name "react-dom/test-utils": name can only contain URL-friendly characters
22 verbose exit [ 1, true ]

Also trying to install it as devDependency via cli gives this error:

npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://[email protected]/react-dom/test-utils.git
npm ERR! 
npm ERR! Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR! 
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR! 
npm ERR! exited with error code: 128

How can I solve this to have those packages available for referencing in the code?

like image 585
zmii Avatar asked Oct 24 '17 14:10

zmii


1 Answers

Add react-dom as a dependency: npm install --save react-dom

When you import react-dom/test-utils it means: import from the test-utils folder/file which is in the react-dom package.

like image 112
ChrisR Avatar answered Sep 19 '22 03:09

ChrisR