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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With