now-pipeline
now-pipeline copied to clipboard
Error: cannot find file .npmignore
Trying to use now-pipeline and get:
Something went wrong Sometimes restarting pipeline can help Error: cannot find file .npmignore at lazyAssLogic (/usr/local/lib/node_modules/now-pipeline/node_modules/lazy-ass/index.js:110:14) at lazyAss (/usr/local/lib/node_modules/now-pipeline/node_modules/lazy-ass/index.js:115:28) at filenames.forEach.name (/usr/local/lib/node_modules/now-pipeline/src/index.js:118:9) at Array.forEach (native) at deploy (/usr/local/lib/node_modules/now-pipeline/src/index.js:117:17)
per now doc (https://zeit.co/docs/features/now-cli#selecting-files-and-directories-to-be-uploaded) .npmignore file is optional. Please advise.
Hmm, if that is the case, it should not throw an exception there. Care to fix this and submit a pull request? I promise to merge it quickly.
This looks like a important PR. Shall I contribute to it ?
What do you suggest we do about this ? pkgd
module basically includes .npmignore
too in the files
. Do we ignore it in this line ?
Hi @karuppiah7890
Thank you for looking at this. I would make a list of optional filenames with .npmignore
, check list of files to deploy against it. If the file is not found and it is in the optional filenames list, skip it
@bahmutov Yeah, makes sense. I will look into it and see what other files are optional in now deployment.
I too am experiencing this issue for some reason. Is this due to an incorrect configuration on my end or is this affecting everyone?
This is a weird issue and I do not completely understand when and why it happens. Might be because I use .gitignore
file that is a sub for .npmignore
?
Can you run the tool with DEBUG=now-pipeline
? This will show the files it is trying to deploy
From CI?
that's where it happens? sure on CI you can either set an environment variable or just update your CI file command, something like
script:
- npm i -g now-pipeline
- DEBUG=now-pipeline now-pipeline
It happens both locally and from ci.
from debug:
+ [email protected]
added 112 packages in 5.33s
npm info ok
+ DEBUG=now-pipeline now-pipeline
Fri, 04 Aug 2017 16:46:01 GMT now-pipeline deploying 11 files
Fri, 04 Aug 2017 16:46:01 GMT now-pipeline [ 'package.json',
'.npmignore',
'bitbucket-pipelines.yml',
'data/test.json',
'now.json',
'readme.md',
'rules.json',
'src/handlers.js',
'src/index.js',
'src/product.js',
'src/index.html' ]
Something went wrong
Sometimes restarting pipeline can help
Error: cannot find file .npmignore
at lazyAssLogic (/usr/local/lib/node_modules/now-pipeline/node_modules/lazy-ass/index.js:110:14)
at lazyAss (/usr/local/lib/node_modules/now-pipeline/node_modules/lazy-ass/index.js:115:28)
at filenames.forEach.name (/usr/local/lib/node_modules/now-pipeline/src/index.js:122:9)
at Array.forEach (native)
at deploy (/usr/local/lib/node_modules/now-pipeline/src/index.js:121:17)
at <anonymous>
I don't have a .npmignore file in my repo, so is now-pipeline adding that somewhere?
I see it in the file array.
no, this list comes from pkgd
that for some reason thinks it should be part of the NPM published package. Hmm, https://github.com/inikulin/pkgd does not have any issues related to this file.
Do you want to fix this (I think it should be done like https://github.com/bahmutov/now-pipeline/issues/20#issuecomment-320054344) ? A pull request with the fix would be greatly appreciated.
Yes I will try to get a PR up within the hour.
I've traced the requirement back to here: https://github.com/npm/fstream-npm/blob/master/fstream-npm.js#L300
It would seem that pkgd is just pulling that entire list and using that as it's requirements. I'm trying to figure out the best way to alter that.
@wulfmann Woah
@wulfmann just have our own "optional" list?
@bahmutov That's a big question to ask. But first, we need to check what now.sh considers optional, since if we don't include that, now.sh is gonna throw errors
For now, we can just keep .npmignore
and see what other similar files are optional for now.sh deployment and not check for them
Yea that should work. I have an idea on how to add an optional list, just making sure I fully understand everything that’s going on.
Though this is hardly a fix, adding an empty .npmignore resolves the issue.
I'm working on a fork to retool the whole file-checking section since there are a few different rules as to which file / property takes precedence.
I put the loop of 'readFileSync' of the filenames in a try catch instead and that allowed the function to continue without the presence of the .npmignore, but threw a 500 server error at the very end. I need to try it with the correct keys but I still think it's an error somewhere else.
I'll keep you guys updated but it will probably take me a few days to get to it. If you have any suggestions i'd love to hear them. This is a great module so I really want to contribute and continue using it.
I'm experiencing this issue as well, debug output here:
https://gist.github.com/anonymous/4a5a337b210c4ecf8084652a83385a34
Do I create a .npmignore
file in Travis?
Apologies that I never got back to this. I've opened a PR with a simple change that should solve the issue.
@spences10 My changes were merged. Whenever the npm package is updated could you check and see if you are still experiencing that issue? I'm working on recreating the issue i had with it back in August to make sure it's all set, but it will likely be confirmed sooner by you.
ok, published as 1.9.0
I'll get on this shortly.
I'll take out the touch .npmignore
from my .travis.yml
so I'm hoping that will get me past this issue, I still haven't managed to get now-pipeline
to push a build I can view with now ls
from my terminal.
Thanks @wulfmann 👍