Missing .gitignore
jboxman opened this issue · 4 comments
I just installed this globally and ran the setup script:
simple-react-app sra-test
Initializing project..
npm init -- done
Installing deps -- it might take a few minutes..
events.js:163
throw er; // Unhandled 'error' event
^
Error: ENOENT: no such file or directory, open '/Users/jasonb/.config/fnm/lib/node_modules/simple-react-app/.gitignore'
I can confirm I have no .gitignore file in that directory.
When NPM creates a package, it wipes out .gitignore
file for default, so globally installed package doesn't have this file in the main directory.
03:42 PM/usr/local/lib/node_modules/simple-react-app $ ls -al
total 48
drwxr-xr-x 11 domin admin 352 Dec 12 15:40 .
drwxr-xr-x 13 domin admin 416 Dec 12 15:40 ..
-rw-r--r-- 1 domin admin 146 Dec 12 14:17 .babelrc
-rw-r--r-- 1 domin admin 472 Aug 15 21:48 .eslintrc
-rw-r--r-- 1 domin admin 1076 Oct 30 01:32 LICENSE
-rw-r--r-- 1 domin admin 3015 Oct 30 02:01 README.md
drwxr-xr-x 3 domin admin 96 Dec 12 15:40 bin
drwxr-xr-x 35 domin admin 1120 Dec 12 15:40 node_modules
-rw-r--r-- 1 domin admin 2425 Dec 12 15:40 package.json
drwxr-xr-x 8 domin admin 256 Dec 12 15:40 src
-rw-r--r-- 1 domin admin 1662 Aug 15 17:21 webpack.config.js
@Kornil I suppose, that you add .npmignore
for fixing this issue, but see npm/npm#3763.
@smalluban I hotfixed this half an hour ago (added .npmignore empty) could you try npm i -g simple-react-app
again? I'm not quite sure this is enough to fix it tho.
@jboxman @smalluban bug has been fixed here:
removed faulty code 8e37fc6
and enabled new copy for .gitignore
here 8c60e1e
Explanation of the bug:
Some OSes (manjaro was golden, could never replicate it) when npm installing module, strip the .gitignore
file, since there were instructions on the code to copy it over it was failing cause there was no source to copy from.
To solve the issue now we get the file from an https.get
request to this repository and then create it with the fetched data.
Fixed on 1.2.2
npm i -g simple-react-app
again and it should now work flawlessy.