You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OS: MacOS 10.15.7 Catalina
Running a command like npx create-react-app . --scripts-version=/some/local/path/to/jv-forked-scripts.tgz --template=cra-template results in an error trying to determine the package name on the scripts package.
My scripts package uses a scoped name like @jv/forked-scripts however the name of the .tgz file that gets created upon npm pack command is jv-forked-scripts.tgz.
Node v12: When using CRA 3.x/4.x in a Node v12 environment, CRA successfully unpacks the .tgz to a temporary location and can correctly infer the package name from the package.json file.
Node v14/v15: When using the same command in a Node v14.x or v15.x environment, I get the following error.
Could not extract the package name from the archive: Cannot find module '/var/folders/10/cdlwly957wzb1mp09v9cppnw0000gp/T/tmp-10364-cuYCB3MNws5F/package.json'
However, when I run a command like ls /var/folders/10/cdlwly957wzb1mp09v9cppnw0000gp/T/tmp-10364-cuYCB3MNws5F/, I can see that my package has been unpacked to this location. I have tried modifying my global cra script to output whether or not the package.json file exists following the unpack command (using fs.existsSync) but it results in a false output. Essentially, CRA is unable to infer the package name and will default to the name of the .tgz file which is not the same as my package name.
This makes is difficult to test local custom scripts and what is ultimately minted does not contain my template.
Did you try recovering your dependencies?
Yes. Always using CRA 4.x
Which terms did you search for in User Guide?
Could not extract the package name from the archive
I am expect CRA to begin minting a new project using my packages. Installing react, react-dom, and @jv/forked-scripts with cra-template
Actual behavior
CRA infers the package name from the filename of the .tgx file.
Could not extract the package name from the archive: Cannot find module '/var/folders/10/cdlwly957wzb1mp09v9cppnw0000gp/T/tmp-10364-cuYCB3MNws5F/package.json'
Require stack:
- /Users/VANGJEF/.nvm/versions/node/v14.16.0/lib/node_modules/create-react-app/createReactApp.js
- /Users/VANGJEF/.nvm/versions/node/v14.16.0/lib/node_modules/create-react-app/index.js
Based on the filename, assuming it is " jv-forked-scripts"
Installing react, react-dom, and jv-forked-scripts with cra-template...
The text was updated successfully, but these errors were encountered:
Describe the bug
OS: MacOS 10.15.7 Catalina
Running a command like
npx create-react-app . --scripts-version=/some/local/path/to/jv-forked-scripts.tgz --template=cra-template
results in an error trying to determine the package name on the scripts package.My scripts package uses a scoped name like
@jv/forked-scripts
however the name of the .tgz file that gets created upon npm pack command isjv-forked-scripts.tgz
.Node v12: When using CRA 3.x/4.x in a Node v12 environment, CRA successfully unpacks the .tgz to a temporary location and can correctly infer the package name from the package.json file.
Node v14/v15: When using the same command in a Node v14.x or v15.x environment, I get the following error.
However, when I run a command like
ls /var/folders/10/cdlwly957wzb1mp09v9cppnw0000gp/T/tmp-10364-cuYCB3MNws5F/
, I can see that my package has been unpacked to this location. I have tried modifying my global cra script to output whether or not thepackage.json
file exists following the unpack command (usingfs.existsSync
) but it results in afalse
output. Essentially, CRA is unable to infer the package name and will default to the name of the .tgz file which is not the same as my package name.This makes is difficult to test local custom scripts and what is ultimately minted does not contain my template.
Did you try recovering your dependencies?
Yes. Always using CRA 4.x
Which terms did you search for in User Guide?
Could not extract the package name from the archive
Environment
OS: MacOS v 10.15.7 Catalina
Node: v14.16 || v15.3
npm: 6.14.11
Steps to reproduce
(Write your steps here:)
Expected behavior
I am expect CRA to begin minting a new project using my packages.
Installing react, react-dom, and @jv/forked-scripts with cra-template
Actual behavior
CRA infers the package name from the filename of the .tgx file.
The text was updated successfully, but these errors were encountered: