-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow private npm packages as templates #8425
Comments
Supporting this use case sounds reasonable, but couldn't it be solved through existing methods such as a .npmrc file? |
hmmm, I didn't know about .npmrc file, I believe puting the access token there should work fine. |
Hi, Even configuring the .npmrc correctly, at the end of the build the customization module is not found in the private npm. log: $ npx create-react-app my-app --template sebrae
Creating a new React app in /Users/ricardo/workspace/my-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template-sebrae...
> [email protected] install /Users/ricardo/workspace/my-app/node_modules/jest-haste-map/node_modules/fsevents
> node-gyp rebuild
SOLINK_MODULE(target) Release/.node
CXX(target) Release/obj.target/fse/fsevents.o
SOLINK_MODULE(target) Release/fse.node
> [email protected] install /Users/ricardo/workspace/my-app/node_modules/watchpack/node_modules/fsevents
> node-gyp rebuild
SOLINK_MODULE(target) Release/.node
CXX(target) Release/obj.target/fse/fsevents.o
SOLINK_MODULE(target) Release/fse.node
> [email protected] install /Users/ricardo/workspace/my-app/node_modules/webpack-dev-server/node_modules/fsevents
> node-gyp rebuild
SOLINK_MODULE(target) Release/.node
CXX(target) Release/obj.target/fse/fsevents.o
SOLINK_MODULE(target) Release/fse.node
> [email protected] postinstall /Users/ricardo/workspace/my-app/node_modules/babel-runtime/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
> [email protected] postinstall /Users/ricardo/workspace/my-app/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
> [email protected] postinstall /Users/ricardo/workspace/my-app/node_modules/core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
added 1811 packages from 770 contributors in 102.158s
58 packages are looking for funding
run `npm fund` for details
internal/modules/cjs/loader.js:638
throw err;
^
Error: **Cannot find module 'cra-template-sebrae'**
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.resolve (internal/modules/cjs/helpers.js:33:19)
at module.exports (/Users/ricardo/workspace/my-app/node_modules/react-scripts/scripts/init.js:110:13)
at [eval]:3:14
at Script.runInThisContext (vm.js:122:20)
at Object.runInThisContext (vm.js:329:38)
at Object.<anonymous> ([eval]-wrapper:6:22)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at evalScript (internal/bootstrap/node.js:589:27)
at startup (internal/bootstrap/node.js:265:9)
Aborting installation.
node has failed.
Deleting generated file... node_modules
Deleting generated file... package.json
Done. Custom template at nexus: .npmrc config: Any solution? |
not working. |
I discovered the problem. The template path within node_modules was not being found. I made the pull request with the following adjustment: javascript:
befor:
after:
|
Hi @itelofilho, can you please confirm that your template has a We've resolve this issue, but until our next release, templates must have a main field - which is required by |
with field main worked. |
Closing this off, thanks for confirming. We'll release the fix for this soon, sorry again. |
Is your proposal related to a problem?
No. I just had to create a project like CRA in my work and we allowed private repositories. I want to know if it is a thing that the CRA community wants in the CLI. If it's ok I could work in a PR.
Describe the solution you'd like
probally a flag like:
npx create react-app --template some-template-name --npm-access-token="123"
The text was updated successfully, but these errors were encountered: