I’m using react-select on my ReactJS module, and I needed to make some changes to fit my needs.
But now, I’m trying to install my own fork using NPM, and it doesn’t work.
Error message:
Module not found: Error: Can't resolve 'react-select'
Tried using gitpkg with the following commands, and it did not work.
npm install 'willnaoosmith/react-select'
npm install 'https://gitpkg.now.sh/willnaoosmith/react-select/packages/react-select?master'
npm install -B 'willnaoosmith/react-select'
The module uses TypeScript, and my changes are on the packages/react-select
.
When I try to install it using npm install 'willnaoosmith/react-select'
it creates a @react-select/monorepo
entry on my package.json
When I try to install using npm install 'https://gitpkg.now.sh/willnaoosmith/react-select/packages/react-select?master'
it doesn’t create the dist
folders on the directories inside node_modules/react-select/packages/react-select/
What am I missing?
2
Answers
Solution: Had to publish my own package version. Bye
If you only want to test your changes locally before publishing to ensure they work you can follow the steps below:
Say, you’re developing an app called
A
andB
is the react-select package you made changes to locally, then:B
and enternpm link
– this willcreate a local package called
B
.A
) folderand enter
npm link B
– this will link your project to the localpackage (
B
).Any changes you make to
B
should reflect inA
without having to publish it.Another option is to use your repository directory with the following steps:
npm install github_username/repository#tag
You can see the following link for details